vb.net如何从数据集保存到数据库
vb是用rs.fields()
[解决办法]
给个例子:
Public Function CreateCmdsAndUpdate(ByVal dataSet As DataSet, _ByVal connectionString As String, ByVal queryString As String) As DataSet Using connection As New OleDbConnection(connectionString) Dim adapter As New OleDbDataAdapter() adapter.SelectCommand = New OleDbCommand(queryString, connection) Dim builder As OleDbCommandBuilder = New OleDbCommandBuilder(adapter) connection.Open() Dim customers As DataSet = New DataSet adapter.Fill(customers) ' Code to modify data in DataSet here adapter.Update(customers) Return customers End UsingEnd Function
[解决办法]