Member_2_5230414
asked on
ExecuteNonQuery: Connection property has not been initialized.
What is wrong with my command to get ExecuteNonQuery: Connection property has not been initialized.
Shared Function editpost(ByVal id As Integer, ByVal title As string, ByVal post As String, ByVal important As String, ByVal forumlock As String) As String
Using con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\perkinj\My Documents\Visual Studio 2010\WebSites\runningprofiles\forums\forum.mdb")
Dim cmd As New OleDbCommand
con.Open()
cmd.CommandText = "UPDATE forum (Title,Post,forumlock,important) VALUES ('" & title & "','', '" & post & "','" & important & "','" & forumlock & "') where ID = '" & id & "'"
cmd.ExecuteNonQuery()
con.Close()
End Using
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Open in new window