V24s

"Get Updates : Subscribe to our e-mail newsletter to receive updates........" "Good Luck frnds" Admission 2018 Application Form 2018 Colleges Entrance Exam 2018 Results 2018 Notification 2018 University Educational Jobs 2018 Government Jobs 2018

Search This Blog v24s guys

Follow by Email

04 April, 2013

c#- How to Convert Dataset to XML String in Asp.net, VB.NET

Introduction:

Here I will explain how to convert dataset to xml string in asp.net using C#, VB.NET.

Description:

In previous posts I explained Convert datatable to xml in asp.net, asp.net, C#, SQL Server Interview Questions, jQuery validate file extension in file upload control, send forgot password as email in asp.netand many articles relating to asp.net, C#, VB.NET code snippets. Now I will explain how to convert dataset to xml string in asp.net using C#, VB.NET.

If you want to convert dataset to xml you need to write a code as shown below

C# Code


DataSet ds = new DataSet();
SqlCommand cmd = new SqlCommand("select * from usersInfo", con);
SqlDataAdapter da=new SqlDataAdapter(cmd);
da.Fill(ds);
string str = ds.GetXml();

VB.NET Code


Dim ds As New DataSet()
Dim cmd As New SqlCommand("select * from usersInfo", con)
Dim da As New SqlDataAdapter(cmd)
da.Fill(ds)
Dim str As String = ds.GetXml()
Post a Comment

Popular Posts

Recent Posts

Google Analytics