hey friends,i need ur help.i need to knw how to insert or add a row to datagridview(using oledb) where the values inserted must be automatically updated in access database.
thanks in advance...

Ok try this.

Connection 'Initialize you PROVIDER AND DATA SOURCE
con.open

sql = "SELECT * FROM YOURTABLE"
cmd = New Oledb.OledbCommand(sql,con)
cmd.commandtype = commandtype.text

da = New Oledb.OledbDataAdapter(cmd)
cb = New Oledb.OledbCommandBuilder(da)
ds = New Dataset
da.fill(ds)

Datagridview1.Datasource = ds.tables(0)

con.close

'Remember you must have to close the connection before you do the .Update command
'Now put this into your update button
da.update(ds.tables(0))
Msgbox("Updated :) ")

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.