Hello guys.I have a problem updating my MS Access from datagrid.
The update button is ther already so I dont need it. I jus need the coding.
Here is what Ive got and I cant geddit correct.Thanx in advance guys.
Protected Sub GridView1_RowUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdatedEventArgs ) Handles GridView1.RowUpdated
Dim cm As New OleDbCommand
Dim con As New OleDbConnection
Dim str1 As String = "Provider = Microsoft.Jet.oledb.4.0; Data source =C:\Documents and Settings\Kagisho.Mashiloane.ALFRGIS\My Documents\Visual Studio 2005\Projects\Search AL\TelephoneList.mdb"
Dim str2 As String
con = New OleDbConnection(str1)
con.Open()
str2 = "select * From Extensions"
cm = New OleDbCommand(str2, con)
Dim updateSQL As String = "UPDATE Extension SET Name = @Name, " & "Surname = @Surname, " & "Xtension = @Xtension"
cm.Parameters.Clear()
cm.Parameters.Add("@Name", Name)
cm.Parameters.Add("@Surname", Surname)
cm.Parameters.Add("@Xtension", Xtension)
cm.ExecuteNonQuery()
'Next
lblUpdatemessage.Text = "Update Successfull"
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks