Line 1: Incorrect syntax near '='.

This is a discussion on "Line 1: Incorrect syntax near '='." within the ASP.NET Forum section. This forum, and the thread "Line 1: Incorrect syntax near '='. are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > ASP.NET Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 7th, 2005, 13:21
dc dc is offline
New Member
Join Date: Aug 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Line 1: Incorrect syntax near '='.

has come across this error??

Code: Select all
Line 1: Incorrect syntax near '='. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '='.

Source Error: 


Line 190:                sqlCmd.Connection = empConn
Line 191:                sqlCmd.CommandText = query
Line 192:                reader = sqlCmd.ExecuteReader()
Line 193:                If reader.Read Then
Line 194:                    caption = reader("roleAbbreviation")
 

Source File: c:\inetpub\wwwroot\TestEnviron\Default.aspx.vb    Line: 192 

Stack Trace: 


[SqlException: Line 1: Incorrect syntax near '='.]
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
   System.Data.SqlClient.SqlCommand.ExecuteReader() +42
   DropDownList.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\TestEnviron\Default.aspx.vb:192
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +750
Reply With Quote

  #2 (permalink)  
Old Sep 8th, 2005, 12:10
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Try this:

Code: Select all
While reader.Read() 
 caption = reader("roleAbbreviation")
End While
Reply With Quote
Reply

Tags
line, incorrect, syntax, near

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
scene syntax Rick Flash & Multimedia Forum 5 Sep 27th, 2007 21:25
incorrect time :S alexgeek PHP Forum 4 Sep 21st, 2007 20:01
Help with syntax tox0tes PHP Forum 3 Sep 3rd, 2007 03:00
Spacing between list items incorrect when span tag is used in a list item... MikeTheVike Web Page Design 5 Apr 18th, 2007 01:52
layout sits incorrect in smaller window, hit F5 to fix! crite Web Page Design 1 Jul 6th, 2005 17:05


All times are GMT. The time now is 06:30.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43