|
![](/images/resource/spacer.gif) |
|
ติดปัญหาการเพิ่มข้อมูลลงฐานข้อมูลครับ มีรูปกับโค้ดให้ดูครับ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ด้านล่างนี้ปกติครับ
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() + "') ";
![Error Error](https://www.thaicreate.com/upload/stock/20151207172358.png?v=1001)
Tag : .NET, Ms Access, Win (Windows App), C#
![](/images/adv.jpg?v=1001)
|
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-12-07 17:25:31 |
By :
pkraiya |
View :
810 |
Reply :
1 |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
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 ออกมาดูครับ
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-12-08 10:08:01 |
By :
mr.win |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 03
|