VB.NET:
Dim ConnectionString As String = "server=dataserver;initial catalog=nash;persist security info=true;user id=sa;password=nimda"
Dim conn As SqlConnection = New SqlConnection(ConnectionString)
conn.Open()
Dim adapter As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM customer ORDER BY ID", conn)
Dim builder As SqlCommandBuilder = New SqlCommandBuilder(adapter)
' Create a dataset object
Dim ds As DataSet = New DataSet("customer")
adapter.Fill(ds, "customer")
' Create a data table object and add a new row
Dim T As DataTable = ds.Tables("customer")
Dim row As DataRow = T.NewRow()
row("cName") = "Aparna shukla"
row("address") = "moon"
'row["ID"] = "10";
T.Rows.Add(row)
MsgBox("Record added")
' Update data adapter
adapter.Update(ds, "customer")
After adding data to table i want added row's id value.
How to get it ??