我有一个简短的问题。我是.net 的新手。有没有办法在我填充它之前将 DataTable 设置为每次清除它?我正在查看 TableAdapter 并看到“ClearBeforeFill 属性”,并认为 DataAdapter 或 DataTables 存在类似的东西。
'Construct query
Dim queryAccountData$ = "SELECT * FROM " & TableName & " WHERE AccountNumber=" & AccountNumber
'Execute query and fill datatable in dataset
Using adapter As New MySqlDataAdapter(queryAccountData, connection)
adapter.Fill(DS, "Holdings")
End Using
With DS.Tables("Holdings")
'Assign variables
rows_lastIndex = .Rows.Count - 1
If rows_lastIndex = -1 Then Throw New ApplicationException("Account Number Not Found In Database")
etc....
谢谢!