Private  sub button1_click( )

Data Set

Dim ds as new dataset
Ds = new dataset(“student”)

Connectionstring

Dim connectionstring as string = “provider =Microsoft.jet.oledb.4.0;data source = student”;
Dim connection1 as oledb.oledbconnection = new oledb.oledbconnection(connectionstring)

Command object

Dim command1 as oledb.oledbcommand = new oledb.oledbcommand(“select * from student”)
Command1.commandtype = command.text
Connection1.open()
Comand1.connection = connection1

Data Adapter

Dim dataadapter1 as oledb.oledbdataadapter = new oledb.oledbdataadapter
 Dataadapter1.selectcommand=command1
Dataadapter1.tablemappings.add(“table’,”student”)
Dataadapter1.fill(ds)
Datagrid1.setbindings(ds,”table”)

Problem:----
Dear above code is used by me .in this code I have created dataset,command ,dataadapter,connection object’s.i have taken MS access database with vb.net 2005.this code only display record from database but when I want to add,delete,update record ‘It generate error that is a specific update,delete,insert command is required’ .so this is the main problem with me which leds frustrate me since last 6six month .i humbly request to all that if anybody can help me for this problem pls guide me with proper code of all with display record in texbox,combobox and Radiobutton.

1 I want ot insert new record in database.(In textbox,combobox,radiobutton)
2 I want to delete record from database(In textbox,combobox,radiobutton)
3 I want to update record . (In textbox,combobox,radiobutton)
PLEASE URGENT.

Recommended Answers

All 2 Replies

If you have struggled for six months you cant have looked very far...the top result from my first google search returned this.

Hi , As you are specified command for filling datatable for the adapter, you have to specify for Insert (Dataadapter1.InsertCommand),update (Dataadapter1.UpdateCommand),Delete (Dataadapter1.DeleteCommand)command for that adapter also.

cheers
A Roy Chowdhury

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.