Using comm As New OleDbCommand()
With comm
.Connection = conn
'.CommandType = CommandType.CommandText
.CommandText = "SELECT * FROM DATA" & Filename
End With
Using adapter As New OleDbDataAdapter(comm)
adapter.Fill(dt)
End Using
End Using
Date :
2014-01-11 22:28:56
By :
หนุ่ย
No. 7
Guest
ได้แล้วนะครับ ใช้ code นี้ครับ VB.net นะ
Using conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & " Data Source=" & newPathMDB & Filename & ".mdb")
Using sqlCommand As New OleDbCommand()
conn.Open()
sqlCommand.Connection = conn
sqlCommand.CommandText = "CREATE TABLE DATA" & Filename & "(IdSN varchar(10), Name varchar(20))"
sqlCommand.ExecuteNonQuery()
sqlCommand.CommandText = "SELECT * FROM DATA" & Filename
Using adapter As New OleDbDataAdapter(sqlCommand)
Using commBuild As New OleDbCommandBuilder(adapter)
adapter.Update(dt)
End Using
End Using
End Using
End Using