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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT: How to Add Identity Col Value !

Status
Not open for further replies.

karth23

Programmer
May 23, 2002
13
US
DsAddressBook1 is the Dataset
The Table "Address_Lst" has an Identity Col "ADDRESS_ID "(seed)

Dim dt As DataTable = DsAddressBook1.Tables("Address_Lst")
Dim dr As DataRow = DsAddressBook1.ADDRESS_LST.NewRow
dr("FIRST_NM") = txtFirstName.Text.Trim
dr("LAST_NM") = txtLastName.Text.Trim
DsAddressBook1.ADDRESS_LST.AddADDRESS_LSTRow(dr)
DAAddressUSA.UpdateCommand = Me.SqlInsertCommand1()

The Above Code not working.
It says
Exception Details: System.Data.NoNullAllowedException: Column 'ADDRESS_ID' does not allow nulls.

I would be appreicated any one give a solution to insert Identity column value to the Table

Note: I have used DataAdapter in Design time and used "Configure DataAdapter". The select,insert and update commands generated automatically.

Karthik Bala
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top