PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
DataGrid Requery
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
DataGrid Requery
![]() |
DataGrid Requery |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I am using a CF +++datagrid to show several rows in a SQLCE table. When I
delete or change a row in the table I would like the datagrid to reflect the change. At the moment I am having to write (for example): sqlcmd = "DELETE FROM Customers WHERE CustID=" & CustID cmd.Connection = cn cmd.CommandText = sqlcmd cmd.ExecuteNonQuery() MsgBox("Customer deleted") ' now to refresh the Datagrid.....!! sqltext = "SELECT CustID,CustName,CustTel,CustBAdd1 FROM Customers" cmd = New SqlCeCommand(sqltext, cn) da = New SqlCeDataAdapter(cmd) dt.Clear() dt = New DataTable("Clients") da.Fill(dt) ds.Tables.Add(dt) Me.DGClients.DataSource = ds.Tables("Clients") What I would love is a function like DGClients.Refresh which would then cause the Datagrid to refresh itself from the datasource. However Refresh just redraws the control. Is there a neater and more efficient way of updating the grid? -- With best wishes Nigel Vandyk 8 Finchley Way, N3 1AG Tel: 020 8349 4714 Fax: 020 8346 2413 Mobile: 07976 655709 Website:www.astarsoftware.co.uk |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

