Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert command and update database

Status
Not open for further replies.

CookieNZ

MIS
Apr 22, 2002
48
NZ
The following sub is used to store in the dataset a new record/row.

With dssupport.Tables("Supportcall")
NewRow = .NewRow()
NewRow("ID") = Me.txtcallnumber.Text
NewRow("Description")=Me.txtcalldescription.Text
.Rows.Add(NewRow)
End With

However when I come to hit the update the database with

Dim NewRow As System.Data.DataRow

I am bombed out with a insertcommand error.

How and where do I configure this?



dbsupport.Update(dssupport, "Supportcall")
 
The Insert Command will be associated with the Data Adapter.
You can create it by selecting the adapter on the form in the Design view and choosing Configure Adapter. I've been using SQL Adapters I'm pretty sure it'll work with the OLE DB adapter as well.

Another way is to create the SQL statement you want in code as a string. Then create a SQL Command and assign the SQL text you created to it. Then use the Execute method of the command.

Or, assign the SQL text you created to the Insert Commmand Text property of the adapter your using. Hope this helps.
 
What would the syntax be if I was to create the SQL command and where would I call it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top