Muhamamd:
Imports System.Data
Imports System.Data.OleDb
Public Class SomeForm
Private cn as OledbCOnnection
Private da as OledbDataAdapter
Private cmdb as OleDbCommandBuilder
Private ds as DataSet
Then down in Form Load
cn = New OledbConnection("someConnectionString")
da = New OleDbDataAdapter("SELECT Blah from SomeTable", cn)
ds = New DataSet("SomeTableName")
da.Fill(ds)
cmdb = new OledbCommandBUilder(da)
Debug.WriteLine(cmdb.GetUpdateCommand.CommandText & " " &
cmdb.GetSelectCommand.CommandTexgt & " Whatever else you want to verify has
been generated")
Then assuming you had a DataGrid (dg)
dg.DataSource = ds.Tables(0)
On an update button or Grid Event that you want to signal update time
da.Update(ds)
ds.AcceptChanges()
If you had a Cancel button
ds.RejectChanges()
I think the Wizard is generating the code for you for update and insert
etc... but if you don't use it, you'll need to use a CommandBuilder
something like I have above, or write your own logic (which is sometimes
worth it, but CommandBuilders will often get you where you need to go)
If you need anything else, or have any questions, let me know.
Good Luck my friend,
Bill
"MUHAMAMD SALIM SHAHZAD" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> dear sir,
>
> thanks a lots as u r like angel and teacher for me...
>
> sir my problem, i want to do everything by programming...as by wizard
> i sucees...but i could nt succes in add, edit delte records...any
> single example will be enought to make me understand this all...
>
> as it seems difficult, which is not ..as i am beginner in database
> vb.net programming
>
> so sir what i wanted to knew there is already i hve first, next, prev,
> last buttons...and even update and load data is ther..but working on
> dataset...but actual data did nt effect...
>
> let us consuder i did all by wizard using da, ds, cn....but even
> though dataset updates records but actual data did not
>
> sir any samples examples of coding of access database will be
> appreciated
>
> thanks u very much
>
> urs obedintly, shahzad
|