Click here to Skip to main content
15,886,077 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In vb.net2005 i want to add and delete records programatically from DataGridView using datasource from MSAccess 2007 , and database contains fields based on date/time and yes/no .

for deleting rows i am using
VB
Dim cmd As OleDbCommandBuilder
cmd = New OleDbCommandBuilder(da)
Dim dt As New DataTable
dt = ds.Tables(0)
dt.Rows(DataGridView1.SelectedRows(0).Index()).Delete()
da.Update(dt)
ds.AcceptChanges()

and to add records i am using
VB
Dim cmd As OleDbCommandBuilder
Dim changes As DataSet
cmd = New OleDbCommandBuilder(da)
changes = ds.GetChanges()
If changes IsNot Nothing Then
    da.Update(ds.Tables(0))
End If
ds.AcceptChanges()

both are working without date and yes/no fields ,but when these included then i am getting error,
can i know how to add & delete when date included

thanks and regards
Posted
Updated 28-Nov-11 8:40am
v3

 
Share this answer
 
Comments
l_d 28-Nov-11 14:56pm    
but i am getting error only when date/time included in MsAccess2007
RaviRanjanKr 28-Nov-11 15:19pm    
what error you are getting. any exception or any error messages.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900