hey im in the middle of creating a little program that allows a user to search and if in admin mode can delete and add a new record to the database i have my search part working fine
i have made the query using the dataset.xsd query builder i used the select, from where query after making the query i have gone to my form and called it using Me.peopleTableAdapter.FillByPeople(systemDataSet.people, Me.peopleTextBox.Text, Me.peopleTextBox.Text, Me.ageTextBox.Text, Me.ageTextBox.Text)
my problem is how do i insert into by database using the dataset.xsd query builder and then calling it in the same way rather than doing dimcon as new ole.db connection as i have set my connection string in the settings of my application
i had made the query
INSERT INTO Admin
(person_Forename, Person_Surname, Admin_Username, Admin_Password)
VALUES (and listed the textboxes used to enter data here)
and then i called it in the same way as i did the select query
but it does not seem to work i dont know where i am going wrong and would really yappriciate if someone could tell me

Recommended Answers

All 3 Replies

>how do i insert into by database using the dataset.xsd query builder and then calling it in the same way rather than doing

Take a look at MSDN - How to configure DataAdapter?

thanks for the link i have followed what it has said to do and now have the dataadapter manually made with the querys but do you know how i call them?

i have created a dataadapter manually and through the wizrd the select,insert,delete and update commands where built. i now need to know the code to call the commands i am trying to insert data from text boxes on a form into the database this is the code i have

OleDbConnection1.Open()
        OleDbDataAdapter1.InsertCommand = New OleDb.OleDbCommand("Insert into Admin(Employee_Forename, Employee_Surname, Admin_Username, Admin_Password) Values (?,?,?,?)", OleDbConnection1)

        OleDbDataAdapter1.InsertCommand().CommandText = ("Insert into Admin(Employee_Forename, Employee_Surname, Admin_Username, Admin_Password) Values (?,?,?,?)")
        OleDbDataAdapter1.InsertCommand.ExecuteNonQuery()

        OleDbDataAdapter1.Update(SystemDataSet)
        SystemDataSet.AcceptChanges()
        OleDbDataAdapter1.Fill(SystemDataSet)

but im getting an error saying a value isnt being given to one or more of the parameters
could someone please tell me where im going wrong

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.