Sunday, October 27, 2013

Convert Dataset to xml string using C#


In my previous post i explained, Save images to database using SQL. Count string occurrence and much more articles realted with asp.net, SQL. Now in this article i will going to explain how to Convert the dataset to xml string using  C# and asp.net 

below is the short and sweet way to convert the dataset into xml.


DataSet dsUser = new DataSet();

SqlCommand cmdSelect = new SqlCommand("select name,age,location,ph,cell,status from userDetails ", conn);

SqlDataAdapter sda = new SqlDataAdapter(cmdSelect);

da.Fill(dsUser);

string strUserDetails = dsUser.GetXml();

Its very simple and easy method. Please post your comments for any suggestion.

Saturday, October 19, 2013

Access content of iframe using jquery



It's very simple and straightforward.

Lets say, your using iframe and hello.aspx page like




1. < iframe id="frametemp" height="20px" width="90px"> </iframe>

which contain some control likes



2. <div id="divDisplayBox" > Say, Hello world! </div>

you can use .contents() method to find the specific id and like

3. $('#frametemp').contents().find('#divDisplayBox').html();

Hope this will helps you, Put your comments/suggestion if any.