Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > .NET

Reply
 
LinkBack Thread Tools
Old September 7th, 2005, 09:21 AM   #1
dc
New Member
 

Join Date: Aug 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 dc is on a distinguished road
Line 1: Incorrect syntax near '='.

has come across this error??

Code:
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
dc is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old September 8th, 2005, 08:10 AM   #2
Highly Reputable Member
 

Join Date: Jul 2003
Location: Ipswich, UK
Posts: 686
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Smokie will become famous soon enough
Try this:

Code:
While reader.Read() 
 caption = reader("roleAbbreviation")
End While
Smokie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
line , incorrect , syntax , near


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 and ActionScript 5 September 27th, 2007 05:25 PM
incorrect time :S alexgeek PHP 4 September 21st, 2007 04:01 PM
Help with syntax tox0tes PHP 3 September 2nd, 2007 11:00 PM
Spacing between list items incorrect when span tag is used in a list item... MikeTheVike HTML, XHTML and CSS 5 April 17th, 2007 09:52 PM
layout sits incorrect in smaller window, hit F5 to fix! crite HTML, XHTML and CSS 1 July 6th, 2005 01:05 PM


Search Engine Optimization by vBSEO 3.2.0 RC8