数据库刷新
添加新行,ACCESS数据库,下面这样不可以吗?Dim dff As DataTable = df.Tables("boss")
Dim mydatarow As DataRow
mydatarow = dff.NewRow
mydatarow(0) = 5
mydatarow(1) = "a"
dff.Rows.Add(mydatarow)
conn.Open()
dt.Update(df, "boss")
conn.Close() --------------------编程问答-------------------- 回答我啊,回答我啊,回答我啊,回答我啊,回答我啊,回答我啊,回答我啊,回答我啊,回答我啊,回答我啊,回答我啊,回答我啊,回答我啊,回答我啊,回答我啊,回答我啊, --------------------编程问答-------------------- df.Tables("boss")
要用OLEDBCOMMANDBUIDER 来生成 --------------------编程问答-------------------- 是的,你在看看我的连接吧
Public filename As String
Public df As New DataSet
Dim i As Integer = 0
Public strconn As String = "E:\vb,net 练习\1\kiss.mdb"
Public strsql As String = "select * from boss"
Public conn As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strconn & ";Persist Security Info=False")
Public dt As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(strsql, conn)
'Public dc As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(dt)
Dim mycb As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(dt)
***************
Dim dff As DataTable = df.Tables("boss")
Dim mydatarow As DataRow
mydatarow = dff.NewRow
mydatarow(0) = 5
mydatarow(1) = "a"
'mydatarow(2) = "a"
'mydatarow(3) = "a"
dff.Rows.Add(mydatarow)
conn.Open()
dt.Update(df, "boss")
conn.Close()
**********************
对不?为什么刷新不了啊
补充:.NET技术 , VB.NET