I have a datagridview which gets its data from a datasource. I have tried a lot of places to find out how I can easily update the rows back to the database but to no use. This is what I have so far:
Now I have a button and I want to update the database upon clicking this button. This is what I have so far inside the click event:
But it doesn't work.
What lines of code do I put inside the click event for this to work?
Conn.ConnectionString = ConnString
Comm.CommandText = SqlString
Comm.Connection = Conn
Conn.Open()
oDa.SelectCommand = Comm
oDa.Fill(oDs, "Directory")
dgvDirs.DataSource = oDs.Tables("Directory")
Now I have a button and I want to update the database upon clicking this button. This is what I have so far inside the click event:
oDa.UpdateCommand = New OleDbCommand("UPDATE Directory SET D_SUBIT_PAGE=@D_SUBMIT_PAGE WHERE D_ID=@D_ID", Conn)
oDa.Update()
But it doesn't work.
What lines of code do I put inside the click event for this to work?