|
|
|
Gridveiw error Must be non-negative and less than the size of the collection |
|
|
|
|
|
|
|
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
error แต่ขึ้นมูลบันทึกเข้า database ตรงกับ index ครับ ไม่ทราบเกิดจากอะไร
protected void inserts_Click(object sender, EventArgs e)
{
// dbcon_3 db_3 = new dbcon_3();
dbcon db = new dbcon();
for (int i = 0; i < GridView1.Rows.Count; i++)
{
db.condatabase("INSERT INTO PlantQcFm130 (plantcode,Tankname,lot,qty,Daily,Daily2,buydrc,buydry,water,dahp,qclot,gas,nh3,tc,tz,tsc,drc,nr,qcnh3,mg,mg2,vfa)VALUES('" + GridView3.Rows[i].Cells[0].Text + "','" + GridView3.Rows[i].Cells[1].Text + "','" + GridView3.Rows[i].Cells[2].Text + "','" + GridView3.Rows[i].Cells[3].Text + "','" + GridView3.Rows[i].Cells[4].Text + "','" + GridView3.Rows[i].Cells[5].Text + "','" + GridView3.Rows[i].Cells[6].Text + "','" + GridView3.Rows[i].Cells[7].Text + "','" + GridView3.Rows[i].Cells[8].Text + "','" + GridView3.Rows[i].Cells[9].Text + "','" + GridView3.Rows[i].Cells[10].Text + "','" + GridView3.Rows[i].Cells[11].Text + "','" + GridView3.Rows[i].Cells[12].Text + "','" + GridView3.Rows[i].Cells[13].Text + "','" + GridView3.Rows[i].Cells[14].Text + "','" + GridView3.Rows[i].Cells[15].Text + "','" + GridView3.Rows[i].Cells[16].Text + "','" + GridView3.Rows[i].Cells[17].Text + "','" + GridView3.Rows[i].Cells[18].Text + "','" + GridView3.Rows[i].Cells[19].Text + "','" + GridView3.Rows[i].Cells[20].Text + "','" + GridView3.Rows[i].Cells[2].Text + "')");
}
Response.Redirect("~/rpt_qcfm130.aspx");
}
เจอละ 55555
for (int i = 0; i < GridView3.Rows.Count; i++)
Tag : .NET, Ms SQL Server 2008, C#
|
ประวัติการแก้ไข 2022-03-02 14:52:29 2022-03-02 15:06:11 2022-03-02 15:09:31
|
|
|
|
|
Date :
2022-03-02 14:51:34 |
By :
dRufFy |
View :
514 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
https://www.thaicreate.com/dotnet/forum/032317.html
|
|
|
|
|
Date :
2022-03-02 15:11:05 |
By :
009 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เจอละ 55555 โอ้ยหนอ
for (int i = 0; i < GridView3.Rows.Count; i++)
ขอบคุณครับ
|
|
|
|
|
Date :
2022-03-02 15:14:14 |
By :
dRufFy |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|