获取新类型数据行的自动ID

时间:2012-10-22 16:15:04

标签: vb.net ado.net

使用table.newTableRow插入新记录时,是否可以获取autoId

这是我的代码:

Dim famtbl As New DataSet1.FamiliesDataTable
Dim newFam = famtbl.NewFamiliesRow

With newFam
    .Address = txt_Address.Text
    .City = txt_City.Text
    .State = txt_State.Text
    .Zip = txt_Zip.Text
    .Country = txt_Country.Text
End With

1 个答案:

答案 0 :(得分:0)

不,在将ID提交给数据库之前,您不会知道该ID。