Cannot find column 2.
 if(dRow[i].ToString ()==line)for (int i = 0; i < maxrows; i++)
                            {
                                dRow = ds.Tables["xml"].Rows[i];
                                if(dRow[i].ToString ()==line)
                                {
                                    //XmlDocument xmldoc = new XmlDocument();
                                    XmlNode docNode = xmldoc.CreateXmlDeclaration("1.0", "UTF-8", null);
                                    xmldoc.AppendChild(docNode);
                                    XmlNode xmlnode,xmlroot;

                                    String sqll = "select Dtd_Tag from Xml_Tags where Mapped_Tags_Attributes.Pdf_Tag=Xml_Tags.Pdf_Tag";
                                    SqlCommand comm = new SqlCommand(sqll);
                                    SqlDataAdapter daa = new System.Data.SqlClient.SqlDataAdapter(sqll, con);
                                    daa.Fill(ds1, "xml");
                                    dRow1 = ds1.Tables["xml"].Rows[i];

                                    string name = XmlConvert.EncodeName(dRow1.ItemArray.GetValue(0).ToString());
                                    xmlnode = xmldoc.CreateElement(name);

                                    XmlNode Doc = xmldoc.CreateDocumentType(name, null, "E:\\Rachana_mds\\proj\\pdfextraction\\docbook.dtd", null);
                                    xmldoc.AppendChild(Doc);
                                    
                                    String sqlll = "select Dtd_Attribute_Name from Mapped_Tags_Attributes where Mapped_Tags_Attributes.Pdf_Tag=Xml_Tags.Pdf_Tag";
                                    SqlCommand cmd = new SqlCommand(sqlll);
                                    SqlDataAdapter dt = new System.Data.SqlClient.SqlDataAdapter(sqlll,con);
                                    dt.Fill(ds2, "xml");
                                    dRow2 = ds2.Tables["xml"].Rows[i];

                                    xmlroot = xmldoc.CreateElement(name);
                                    xmldoc.AppendChild(xmlroot);
                                    XmlAttribute xmlatt = xmldoc.CreateAttribute(dRow2.ItemArray.GetValue(0).ToString());                                                                        
                                    xmlroot.AppendChild(xmlnode);
                                    xmlnode.InnerText = sub;
                                             
Cannot find column 2.
===

 if(dRow[i].ToString ()==line)for (int i = 0; i < maxrows; i++)
                            {
                                dRow = ds.Tables["xml"].Rows[i];
                                if(dRow[i].ToString ()==line)
                                {
                                    //XmlDocument xmldoc = new XmlDocument();
                                    XmlNode docNode = xmldoc.CreateXmlDeclaration("1.0", "UTF-8", null);
                                    xmldoc.AppendChild(docNode);
                                    XmlNode xmlnode,xmlroot;

                                    String sqll = "select Dtd_Tag from Xml_Tags where Mapped_Tags_Attributes.Pdf_Tag=Xml_Tags.Pdf_Tag";
                                    SqlCommand comm = new SqlCommand(sqll);
                                    SqlDataAdapter daa = new System.Data.SqlClient.SqlDataAdapter(sqll, con);
                                    daa.Fill(ds1, "xml");
                                    dRow1 = ds1.Tables["xml"].Rows[i];

                                    string name = XmlConvert.EncodeName(dRow1.ItemArray.GetValue(0).ToString());
                                    xmlnode = xmldoc.CreateElement(name);

                                    XmlNode Doc = xmldoc.CreateDocumentType(name, null, "E:\\Rachana_mds\\proj\\pdfextraction\\docbook.dtd", null);
                                    xmldoc.AppendChild(Doc);
                                    
                                    String sqlll = "select Dtd_Attribute_Name from Mapped_Tags_Attributes where Mapped_Tags_Attributes.Pdf_Tag=Xml_Tags.Pdf_Tag";
                                    SqlCommand cmd = new SqlCommand(sqlll);
                                    SqlDataAdapter dt = new System.Data.SqlClient.SqlDataAdapter(sqlll,con);
                                    dt.Fill(ds2, "xml");
                                    dRow2 = ds2.Tables["xml"].Rows[i];

                                    xmlroot = xmldoc.CreateElement(name);
                                    xmldoc.AppendChild(xmlroot);
                                    XmlAttribute xmlatt = xmldoc.CreateAttribute(dRow2.ItemArray.GetValue(0).ToString());                                                                        
                                    xmlroot.AppendChild(xmlnode);
                                    xmlnode.InnerText = sub;
                                             