|
|
|
ติดปัญหาการเพิ่มข้อมูลลงฐานข้อมูลครับ มีรูปกับโค้ดให้ดูครับ |
|
|
|
|
|
|
|
ด้านล่างนี้ปกติครับ
Code (C#)
command.CommandText = "insert into Student (ID,Title,Fname,Lname) values('" + txtID.Text.Trim()+ "','" + txtTitle.Text.Trim() + "','" + txtName.Text.Trim() + "','" + txtLname.Text.Trim() + "') ";
พอเพิ่มคอรัมก็เกิด Errorครับ
Code (C#)
command.CommandText = "insert into Student (ID,Title,Fname,Lname,Bev,Day,Teacher,Class,Notes) values('" + txtID.Text.Trim()+ "','" + txtTitle.Text.Trim() + "','" + txtName.Text.Trim() + "','" + txtLname.Text.Trim() + "','" + txtBev.Text.Trim() + "','" + txtDay.Text.Trim() + "','" + txtTeacher.Text.Trim() + "','" + txtClass.Text.Trim() + "','" + txtNotes.Text.Trim() + "') ";
Tag : .NET, Ms Access, Win (Windows App), C#
|
|
|
|
|
|
Date :
2015-12-07 17:25:31 |
By :
pkraiya |
View :
784 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (C#)
String strSQL = "insert into Student (ID,Title,Fname,Lname,Bev,Day,Teacher,Class,Notes) values('" + txtID.Text.Trim()+ "','" + txtTitle.Text.Trim() + "','" + txtName.Text.Trim() + "','" + txtLname.Text.Trim() + "','" + txtBev.Text.Trim() + "','" + txtDay.Text.Trim() + "','" + txtTeacher.Text.Trim() + "','" + txtClass.Text.Trim() + "','" + txtNotes.Text.Trim() + "') ";
command.CommandText = strSQL;
ลอง Debug เอาค่า strSQL ออกมาดูครับ
|
|
|
|
|
Date :
2015-12-08 10:08:01 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|