Hello,
I have a datagrid with 2 columns.Both the columns have textboxes where user will enter data.And at the end of the grid there will be button in insert all the data into the table.
I have user xml variable in my stored procedure.
In the gridview I have kept autogenerated false
<asp:gridview id="dgItem" runat="server" autogeneratecolumns="False" height="160px" allowpaging="true" showfooter ="true">
This is what I have written in the C# code and its giving me error.
Please help me in this.
protected void btnsubmit_Click(object sender, EventArgs e) {
int schemaid;
schemaid = tocheaderstyle.InsertTOCNumberingSchema(txtname.Text);
String xmlList = GetList();
tocheaderstyle.InsertTOCCounterStyle(schemaid,xmlList);
}
private String GetList() {
XmlDocument doc = new XmlDocument();
XmlElement elem = doc.CreateElement("xmlList");
doc.AppendChild(elem);
XmlElement root = doc.DocumentElement;
for (int i = 0; i < dgItem.Rows.Count; i++)
{
XmlElement infoEle = doc.CreateElement("xl");
DataRowView drv = (DataRowView)dgItem.Rows[i].DataItem;
TextBox tb = (TextBox)dgItem.Rows[i].FindControl("txtdrgno");
TextBox tb1 = (TextBox)dgItem.Rows[i].FindControl("txtdrgno1");
}
string s = doc.InnerXml;
return s;
}
}
Thank You