M
Mike.Kanet
I have been trying for the last couple of weeks to insert a new record
to a database. I have been able to update the existing records but
when I try to insert it does nothing, not even give me an error code.
Below is a sample of what I've tried lately:
Try
DataAdapter.InsertCommand.Parameters(0).Value =
txtProfileLastName.Text
DataAdapter.InsertCommand.Parameters(1).Value =
txtProfileFirstName.Text
.....
DataAdapter.InsertCommand.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex)
End Try
Some other facts that may help. I used the wizard to add the
dataadapters, datasets, and connection. The primary key for the table
in the database is an autonumber if that makes a difference. I am not
passing any values for it. Any help would be great. I have tried
everything I have found in these forums and others and none have
worked. Thanks in advance.
Mike
to a database. I have been able to update the existing records but
when I try to insert it does nothing, not even give me an error code.
Below is a sample of what I've tried lately:
Try
DataAdapter.InsertCommand.Parameters(0).Value =
txtProfileLastName.Text
DataAdapter.InsertCommand.Parameters(1).Value =
txtProfileFirstName.Text
.....
DataAdapter.InsertCommand.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex)
End Try
Some other facts that may help. I used the wizard to add the
dataadapters, datasets, and connection. The primary key for the table
in the database is an autonumber if that makes a difference. I am not
passing any values for it. Any help would be great. I have tried
everything I have found in these forums and others and none have
worked. Thanks in advance.
Mike