Skip to main content

Convert Data Table into XML in Asp.Net and pass it to sql server database

Code :


dt.TableName = "dt";
                                string XMLData = "";
                                using (StringWriter sw = new StringWriter())
                                {
                                    dt.WriteXml(sw, false);
                                    XMLData = ParseXpathString(sw.ToString());
                                }

                                SqlParameter[] param = new SqlParameter[2];
                                DataSet ds = new DataSet();
                                //param[0] = new SqlParameter("@RegistrationNo", login Name);
                                param[0] = new SqlParameter("@grouptag", previousloginname);
                                param[1] = new SqlParameter("XMLData", SqlDbType.Xml);
                                param[1].Value = XMLData;
                                ds = SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "procedure _Name", param);
                                lblPnlPreferencesException.ForeColor = System.Drawing.Color.Green;
                                lblPnlPreferencesException.Text = "Submited Successfully";

Comments

Popular posts from this blog

Snake Xenzia

Hello friends did you remember the GAME you play on nokia 1100 , SNAKE XENZIA .Yeah the same you are thinking ,a snake eating food and go longer and longer till it dies. Why to play it on mobile when it is available on your pc ??? It is made in .net framework 4.0 .Just install the setup and play SNAKE XENZIA . Have Fun !! DOWNLOAD IT   HERE  . Related articles Rattlesnake Dreams "Classsic Snake Game In C"? Resident Evil 6 gamescom demo takes in a giant snake battle Snakes & ladders

New Smartphone with 12GB RAM, 1TB storage unveiled

Here is the News -- Turing Robotics Industries (TRI) has unveiled its latest smartphone - the Turing Phone Cadenza. It comes with 'Voice On' technology which enables the smartphone to be switched On/Off using voice commands. Users can also use these voice commands for biometric authentication. The Turing Phone Cadenza features a 5.8-inch Quad HD display of 1440x2560 pixel resolution. It is powered by not one, but two Qualcomm Snapdragon 830 (even though the same hasn't been officially announced) CPUs paired with a an astonishing 12GB of RAM and 1TB of internal storage. The storage can be further expanded up to 500GB by installing a microSD card. The Cadenza runs Turing's own Swordfish OS with deep learning Artificial Intelligence (AI) features a 60MP rear camera with IMAX 6K recording facility and a 20MP dual-front camera. Users can install up to 4 sim cards in the smartphone and it houses a huge 100Wh battery with graphene and hydrogen fuel cells.  In related ne...

Export Doc,Access,Image,CSV,Excel,Pdf,XML,HTML,Text,Print of Gridview in Asp.net

First import itextsharp.dll in the solution and use three namespces (basically for pdf) using iTextSharp.text; using iTextSharp.text.pdf; using iTextSharp.text.html.simpleparser;          Then Use the following code :- on each button  click  protected void Page_Load(object sender, EventArgs e)         {             if (!Page.IsPostBack)             {                 BindGridDetails(GridView1);             }         }                 protected DataTable BindGridDetails(GridView GridView1)         {   ...