Forum Moderators: open

Message Too Old, No Replies

ASP.Net error

         

travis2

8:03 am on Oct 16, 2005 (gmt 0)

10+ Year Member



Anyone has an idea whats does that mean?

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30456: 'ExecuteNonQuery' is not a member of 'System.Data.OleDb.OleDbConnection'.

Source Error:

Line 67: objCommand = New OleDbCommand(strUpdate, objConnection)
Line 68:
Line 69: objConnection.ExecuteNonQuery
Line 70:
Line 71: objConnection.Close

My codes:

Public Sub DataGrid_Update(Source As Object, E As DataGridCommandEventArgs)
Dim objConnection As OleDbConnection
Dim objCommand As OleDbCommand
Dim updateProductName As TextBox = E.Item.Cells(2).Controls(0)
Dim updateUnitPrice As TextBox = E.Item.Cells(3).Controls(0)
Dim updateQuantity As TextBox = E.Item.Cells(4).Controls(0)
Dim strUpdate As String
Dim strConnect As String

strUpdate = "UPDATE products SET " & "ProductName = '" & updateProductName.Text & "', " & "UnitPrice = '" & updateUnitPrice.Text & "', Quantity = '" & updateQuantity.Text & "' WHERE ProductID = " & E.Item.Cells(1).Text

strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;"
strConnect += "Data Source=C:\inetpub\wwwroot\ASP.NET\db\sample.mdb;"
strConnect += "Persist Security Info = False"

objConnection = New OleDbConnection(strConnect)
objConnection.Open()
objCommand = New OleDbCommand(strUpdate, objConnection)

objConnection.ExecuteNonQuery

objConnection.Close

DataGrid1.EditItemIndex = -1
bind()
End Sub

anyone could help? i don't understand what's the error about?

john_k

8:36 am on Oct 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld!

The error message tells you what is wrong: ExecuteNonQuery is not a member of OleDbConnection.

It is, however, a member of the command object.

Search for ExecuteNonQuery in your favorite search engine for details.

Ossifer

3:54 pm on Oct 16, 2005 (gmt 0)

10+ Year Member



Change to

objCommand.ExecuteNonQuery()

travis2

2:44 am on Oct 17, 2005 (gmt 0)

10+ Year Member



hey dude.. thanks, it works..