Computing.Net > Forums > Programming > VB.NET, error on SQL Update

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB.NET, error on SQL Update

Reply to Message Icon

Name: mking (by mkingrey)
Date: August 29, 2005 at 08:32:09 Pacific
OS: xp
CPU/Ram: xp
Comment:

When I try to update a row in a database I get an error. I think the problem is either with the SQL statement or the fact that I'm using the .ExecuteNonQuery method with the Update statement. Does anyone have any suggestions why this doesn't work?

Dim varStatement As String = "UPDATE Employee2 SET SelectEmp =" & EmployeeName & " WHERE ID =" & MaxID
Dim myCommand As New OleDbCommand(varStatement, dbConnection)
myCommand.Connection.Open()
myCommand.ExecuteNonQuery()
dbConnection.Close()



Sponsored Link
Ads by Google

Response Number 1
Name: mking (by mkingrey)
Date: August 29, 2005 at 10:56:58 Pacific
Reply:

I fixed the problem. I needed a space between: = " & MaxID


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB.NET, error on SQL Update

vb.net errors www.computing.net/answers/programming/vbnet-errors/12392.html

VB.NET Programming for SQL Server www.computing.net/answers/programming/vbnet-programming-for-sql-server/8306.html

VB.net Error www.computing.net/answers/programming/vbnet-error/4447.html