填充前自动清除DataTable

时间:2013-07-25 13:22:50

标签: mysql .net datatable dataset

我刚才有一个简短的问题。我是.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....

谢谢!

0 个答案:

没有答案