Hi, all
I confused that datagrid cannot update to db.
I create a dataset and fill in the datagrid component.
Private Sub frmCountry1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dim sSQL as string
dim da as new dataAdapter()
dim ds as new dataSet()
sSQL = "SELECT * FROM COUNTRY"
da = New SqlDataAdapter(sSQL, sConnString)
da.TableMappings.Add("Table", "TMP")
da.Fill(ds)
datagrid1.DataSource = ds.Tables("TMP")
End Sub
When I modify the records in datagrid, I can't update to database...
How can I do it?
I have try this.... :confused: no effect .... :o
ds.Tables("TMP").AcceptChanges()
da.Update(ds)