|
|
|
ช่่วยด้วยครับ ติดปัญหาการอัพเดทข้อมูลใหม่ลง ฐานข้อมูล Access ครับ VB2010 |
|
|
|
|
|
|
|
ตามภาพเลยครับ จุดที่ Error
อันนี้โค้ดครับ
Dim str As String = "UPDATE Products SET pro_id=@pro_id,name=@name,unit_price=@unit_price,categories=@categories,detail=@detail,stock=@stock WHERE pro_id=@pro_id"
With Com
.CommandText = str
.CommandType = CommandType.Text
.Connection = Conn
.Transaction = tr
.Parameters.Clear()
.Parameters.Add("@pro_id", OleDbType.VarChar).Value = txtproid.Text.Trim()
.Parameters.Add("@name", OleDbType.VarChar).Value = txtnamep.Text.Trim()
.Parameters.Add("@unit_price", OleDbType.VarChar).Value = txtpricep.Text.Trim()
.Parameters.Add("@categories", OleDbType.VarChar).Value = cbbcatp.Text.Trim()
.Parameters.Add("@detail", OleDbType.VarChar).Value = txtdetailp.Text.Trim()
.Parameters.Add("@stock", OleDbType.VarChar).Value = txtstock_s.Text.Trim()
End With
Com.ExecuteNonQuery()
Tag : .NET, Ms Access, VS 2010 (.NET 4.x)
|
|
|
|
|
|
Date :
2014-08-30 14:19:44 |
By :
Ballriffer |
View :
761 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (VB.NET)
Dim str As String = "UPDATE Products SET pro_id=@pro_id,name=@name,unit_price=@unit_price,categories=@categories,detail=@detail,stock=@stock WHERE pro_id=@pro_id"
With Com
.CommandText = str
.CommandType = CommandType.Text
.Connection = Conn
.Transaction = tr
.Parameters.Clear()
.Parameters.Add("@pro_id", OleDbType.VarChar).Value = txtproid.Text.Trim()
.Parameters.Add("@name", OleDbType.VarChar).Value = txtnamep.Text.Trim()
.Parameters.Add("@unit_price", OleDbType.VarChar).Value = txtpricep.Text.Trim()
.Parameters.Add("@categories", OleDbType.VarChar).Value = cbbcatp.Text.Trim()
.Parameters.Add("@detail", OleDbType.VarChar).Value = txtdetailp.Text.Trim()
.Parameters.Add("@stock", OleDbType.VarChar).Value = txtstock_s.Text.Trim()
End With
Com.ExecuteNonQuery()
|
|
|
|
|
Date :
2014-08-30 14:20:30 |
By :
Ballriffer |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|