|
|
|
[ขอความช่วยเหลือ] เวลากดบันทึกข้อมูลลง sql แล้วมันแจ้งว่าไม่ผ่าน |
|
|
|
|
|
|
|
Code (VB.NET)
Dim sql As String = ""
sql = "INSERT INTO po1 (PO_ID,ID,NAME,Timeproduct,PRICE,MEMID,Firstname_m,Lastname_m,EMPID,Firstname_e,Lastname_e,COMMISSION,Employee_wage,Owner_wage,Date,Time) VALUES (@PO_ID,@ID,@NAME,@Timeproduct,@PRICE,@MEMID,@Firstname_m,@Lastname_m,@EMPID,@Firstname_e,@Lastname_e,@COMMISSION,@Employee_wage,@Owner_wage,@Date,@Time)"
dc = New SqlCommand(sql, sqlcon)
For r As Integer = 0 To dg2.RowCount - 1
With dc
.Parameters.AddWithValue("PO_ID", (txtpo_id.Text))
.Parameters.AddWithValue("ID", dg2.Rows(r).Cells(9).Value)
.Parameters.AddWithValue("NAME", dg2.Rows(r).Cells(0).Value)
.Parameters.AddWithValue("Timeproduct", dg2.Rows(r).Cells(1).Value)
.Parameters.AddWithValue("PRICE", dg2.Rows(r).Cells(3).Value)
.Parameters.AddWithValue("MEMID", (txtMEMID.Text))
.Parameters.AddWithValue("Firstname_m", (txtFirstname_m.Text))
.Parameters.AddWithValue("Lastname_m", (txtLastname_m.Text))
.Parameters.AddWithValue("EMPID", (txtEMPID.Text))
.Parameters.AddWithValue("Firstname_e", dg2.Rows(r).Cells(2).Value)
.Parameters.AddWithValue("Lastname_e", (txtLastname_e.Text))
.Parameters.AddWithValue("COMMISSION", dg2.Rows(r).Cells(6).Value)
.Parameters.AddWithValue("Employee_wage", dg2.Rows(r).Cells(7).Value)
.Parameters.AddWithValue("Owner_wage", dg2.Rows(r).Cells(8).Value)
.Parameters.AddWithValue("Date", dg2.Rows(r).Cells(5).Value)
.Parameters.AddWithValue("Time", dg2.Rows(r).Cells(4).Value)
End With
MessageBox.Show("บันทึกข้อมูลสำเร็จ", "ร้านเฮอบัลสปา", MessageBoxButtons.OK)
dc.ExecuteNonQuery()
dc.Parameters.Clear()
Tag : .NET, VB.NET, VS 2010 (.NET 4.x)
|
|
|
|
|
|
Date :
2015-07-09 17:06:22 |
By :
indygunaza |
View :
832 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data type ไม่ตรงกับที่ออกแบบไว้นิครับ
|
|
|
|
|
Date :
2015-07-09 17:22:23 |
By :
lamaka.tor |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|