 |
|
ใช้ คำสั่ง TableAdapter.Update แล้วไม่สามารถบันทึกข้อมูลลง DB ได้ครับ
ข้อมูลนั้นจะไปอยู่ใน bin/debug/xxxx.accdb ครับ
ไม่ทราบว่า จะทำยังไงให้มันบันทึกอยู่ใน ฐานข้อมูลที่ตั้งไว้ครับ
ผมลองหาจาก Google แล้วเป็นกันหลายคน ลองแก้แล้วก็ไม่สามารถแก้ได้ครับ
รบกวนช่วยทีครับ
ขอบคุณมากครับ
Code ที่ใช้ครับ
Code (VB.NET)
Try
Me.Validate()
Me.MemberBindingSource.EndEdit()
Me.MemberTableAdapter.Update(Me.RentbookDataSet.Member)
MsgBox("Update successful")
Catch ex As Exception
MsgBox("Update failed")
End Try
พอลองเปลี่ยนเป็นแบบ INSERT ก็ไม่ขึ้นใน Datagridview ครับ
Code (VB.NET)
connectData()
Dim Sql As String
Sql = "INSERT INTO Member(Name,LastName,Address,Phone,IDCard)VALUES ("
Sql += "'" & txtName.Text & "',"
Sql += "'" & txtLastName.Text & "',"
Sql += "'" & txtAddress.Text & "',"
Sql += "'" & txtPhone.Text & "',"
Sql += "'" & txtIDCard.Text & "'"
Sql += ")"
ExecuteSQL(Sql)
MessageBox.Show("บันทึกเรียบร้อยแล้ว", "ยืนยัน")
Tag : .NET, Ms Access, Win (Windows App), VB.NET, VS 2010 (.NET 4.x), Windows
|
|
 |
 |
 |
 |
Date :
2014-12-24 04:45:34 |
By :
totalism53 |
View :
1129 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |