Introduction:
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.net
and 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.
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()
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
0 comments :
Note: Only a member of this blog may post a comment.