updating and editing MS ACCESS DATA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi
is there any code that i can use to access my table in ms access databas
example
i want to add employee data on employee tabl
edit employee dat
delete employee dat
help me pls

thanks,
 
You can configure a OleDbDataAdapter and call its .Fill method on a dataset
(Specifying a table name) or datatable . You can use the syntax

DataRow dro = DataSetName.Tables[0].NewRow();
//set each value of the dro here
DataSetName.Tables[0].Rows.Add(dro);

to add a row.

You can call the .Delete method of a datatable to mark a row for deletion
DataSetName.Tables[TableIndex].Rows[RowIndex].Delete();

When you are done, call the Update method on the same dataadapter (or
another one that's configured properly) and the same dataset/datattable to
push the changes back to the db, provided of course you have provided or
configured proper Update/Insert/Delete commands for it.

I'm not sure if you want to accomplish all of this through databound
controls or what but this is the basic way you approach the subject. you
can use a BindingContext to bind the controls. Anyway, I can't tell if you
are stuck or don't know where to begin..if it's the latter I know I probably
jumped over some stuff so just let me know.

Cheers

Bill

www.devbuzz.com
www.knowdotnet.com
 
thanks for good response, i'm sure it will work, cause i haven,t try it

and there is something i want to ask
currently i am designing a spareparts manager application and i have my problem in my withdrawal form,
and my question is, is it posible to use two dataset in a single form? can i filter my dataset base on th
of me combobox? basically when i withdraw a parts, my datasource is table spareparts and when i complete my withdrawal i will saved it on my withdrawal table, at the same time updating the quantity of the curren
part on my spareparts table

thnks

resti
 
Back
Top