|
|
|
Syntax error in UPDATE Statement ไม่ทราบว่่าผิดตรงไหนครับ |
|
|
|
|
|
|
|
Insert ได้ แต่ Update Syntax error in UPDATE Statement ไม่ทราบว่าผิดตรงไหนอ่ะครับ
Code (VB.NET)
Select Case ActionFlag
Case "Add"
sqlMember = "INSERT INTO Member(MemberID,MemberPass,Firstname,Lastname,Sex,IDCard,"
sqlMember &= "Address,Phone,Email,AdmitDate,Balance,Point)"
sqlMember &= "VALUES('" & txtMem_id.Text & "',"
sqlMember &= "'" & txtPass.Text & "',"
sqlMember &= "'" & txtFname.Text & "',"
sqlMember &= "'" & txtLname.Text & "',"
If optMale.Checked = True Then
sqlMember &= "'M',"
ElseIf optFemale.Checked = True Then
sqlMember &= "'F',"
End If
sqlMember &= "'" & txtIDCard.Text & "',"
sqlMember &= "'" & txtAddress.Text & "',"
sqlMember &= "'" & txtPhone.Text & "',"
sqlMember &= "'" & txtEmail.Text & "',"
sqlMember &= "'" & dtpAdmitDate.Value & "',"
sqlMember &= "'" & txtBalance.Text & "',"
sqlMember &= "'" & txtPoint.Text & "')"
Case "Edit"
sqlMember = "UPDATE Member"
sqlMember &= "SET MemberPass='" & txtPass.Text & "',"
sqlMember &= "Firstname='" & txtMem_id.Text & "',"
sqlMember &= "Lastname='" & txtLname.Text & "',"
If optMale.Checked = True Then
sqlMember &= " Sex='M',"
ElseIf optFemale.Checked = True Then
sqlMember &= " Sex='F',"
End If
sqlMember &= "IDCard='" & txtIDCard.Text & "',"
sqlMember &= "Address='" & txtAddress.Text & "',"
sqlMember &= "Phone='" & txtPhone.Text & "',"
sqlMember &= "Email='" & txtEmail.Text & "',"
sqlMember &= "AdmitDate='" & dtpAdmitDate.Text & "',"
sqlMember &= "Balance='" & txtBalance.Text & "',"
sqlMember &= "Point='" & txtPoint.Text & "',"
sqlMember &= "WHERE(MemberID='" & txtMem_id.Text & "')"
End Select
Tag : .NET, VB.NET, VS 2008 (.NET 3.x)
|
|
|
|
|
|
Date :
2010-12-26 11:12:48 |
By :
neungcr |
View :
1226 |
Reply :
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (VB.NET)
sqlMember &= " SET MemberPass='" & txtPass.Text & "',"
sqlMember &= " WHERE(MemberID='" & txtMem_id.Text & "')"
2จุดที่ต้องเว้นวรรคครับ
|
|
|
|
|
Date :
2010-12-26 12:10:21 |
By :
EucifeR |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ผมลองเว้นแล้วก้เป้นเหมือนเดิมอะครับท่าน
|
|
|
|
|
Date :
2010-12-26 12:33:59 |
By :
neungcr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (VB.NET)
sqlMember &= "Point='" & txtPoint.Text & "'" <---------------- ไม่มี ,
sqlMember &= " WHERE(MemberID='" & txtMem_id.Text & "')"
ต้องอย่างนี้ด้วยนะครับ
|
ประวัติการแก้ไข 2010-12-26 12:39:49
|
|
|
|
Date :
2010-12-26 12:38:29 |
By :
EucifeR |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากครับได้ละ ไม่เก็บในพารามิเตอร์นี่ดูยากจริงๆ*-*
|
|
|
|
|
Date :
2010-12-26 12:45:35 |
By :
neungcr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เหอ ๆ ๆ ครับ สู้ๆ ต่อไป
|
|
|
|
|
Date :
2010-12-26 12:53:20 |
By :
EucifeR |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เจอแบบเดียวกับผมเลย เหอะ ๆๆ ลืมเอา (,) ออก 5555 เป็นงง
|
|
|
|
|
Date :
2010-12-26 13:57:06 |
By :
angelrings0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|