|
|
|
สอบถามหน่อยครับพอดี ทำการ insert ใน gridControl Devxepress พอบันทึก มันลูปไม่หยุดเลย |
|
|
|
|
|
|
|
Code (C#)
private void btnadd_Click(object sender, EventArgs e)
{
try
{
for (int i = 0; i < gridView1.DataRowCount; i++)
{
string name = Convert.ToString(gridView1.GetRowCellValue(i, "name"));
string Username = Convert.ToString(gridView1.GetRowCellValue(i, "Username"));
string Password = Convert.ToString(gridView1.GetRowCellValue(i, "Password"));
string sqluser = "INSERT INTO Login(name,Username,Password) VALUES('" + name + "' , '" + Username + "', '" + Password + "')";
connect_db.ExcuteData(sqluser);
showdgvmainuser();
}
MessageBox.Show("Successfully!");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
Tag : .NET, Ms SQL Server 2008, Win (Windows App), C#, VS 2012 (.NET 4.x)
|
|
|
|
|
|
Date :
2017-02-18 11:39:59 |
By :
kittisak30 |
View :
820 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้แล้วครับ ใส่ INSERT ผิดที่
|
|
|
|
|
Date :
2017-02-18 11:58:08 |
By :
kittisak30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2017-02-19 12:48:02 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|