|
|
|
Wednesday, 01 February 2012 04:28 |
Following code will give you the XML representation of the data stored in the DataSet.
DataSet mydataSet = new DataSet();
DataTable table = dataSet.Tables.Add("Items");
mytable.Columns.Add("studentid", typeof(int));
mytable.Columns.Add("name", typeof(string));
mytable.Rows.Add(1,'mac');
mytable.Rows.Add(2,'jac');
mydataSet.GetXml()
 Read more: |
|
|
Wednesday, 01 February 2012 04:21 |
Following code copies structure of the DataSet, along with datatable relations, constraints and schemas.
Keep it in mind that it does not copy any data.
DataSet datasetcolone= mydataset.Clone();
 Read more: |
|
|
Thursday, 17 February 2011 03:24 |
// description of your code here
ID="DetailsView1"
runat="server"
DataSourceID="ObjectDataSource"
AllowPaging="true">
ID="ObjectDataSource"
runat="server"
TypeName="RequestListing"
SelectMethod="GetAllRequests">
//class
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
public class RequestListing
{
private static string _cnnString = ConfigurationManager.ConnectionStrings [ "ApplicationServices" ].ToString();
public static DataTable GetAllRequests()
{
SqlDataAdapter adp = new SqlDataAdapter( "select * from requests", _cnnString );
DataSet ds = new DataSet( "requests" );
adp.Fill( ds, "requests" );
return ds.Tables [ "requests" ];
}
}
 Read more: |
|
|
|
|
|