Hi..
Look into the below example:-
protected void btnSave_Click(object sender, EventArgs e)
{
try
{
foreach (GridViewRow gr in gvAFBatProc.Rows)
{
sbQry.Clear();
sbQry.Append("INSERT INTO " + dbName + "tbl<pre>"
sbQry.Append("(BID, BATCH_NO, LOAD_NO, SECTION_NO, LOT_NO) VALUES(");
sbQry.Append(strBatchNo + ", ");
sbQry.Append(strBatchNo.Remove(0, 7).Trim() + ", ");
sbQry.Append("'" + ((Label)gr.FindControl("lblLoadNo")).Text + "', ");
sbQry.Append("'" + ((Label)gr.FindControl("lblSectionNo")).Text + "', ");
sbQry.Append("'" + ((Label)gr.FindControl("lblLotNo")).Text + "' ");
sbQry.Append(")");
OraObj.ExecuteQry(sbQry.ToString());
}
}
catch (Exception ex)
{
}
}
<pre lang="c#">
Regards
Willington