Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: C#
Expertise: Intermediate
Sep 20, 2004

Create and Retrieve a Named DataSet

This C# function creates and retrieves a named DataSet using an open connection and a command.

public System.Data.DataSet dsReturnedDataSetFrom(System.Data.SqlClient.SqlConnection
sqlOpenConn, System.Data.SqlClient.SqlCommand TheSQLCommand, string TheQueriedTable, string
TheDatasetName)
{
TheSQLCommand.Connection = sqlOpenConn;
System.Data.SqlClient.SqlDataAdapter NewDA = new System.Data.SqlClient.SqlDataAdapter
(TheSQLCommand);
DataSet NewDS = new DataSet();
TheDatasetName.Trim();
NewDS.DataSetName=TheDatasetName;
NewDA.Fill(NewDS, TheQueriedTable);
NewDA.Dispose();
return NewDS;
}
Victor Stefanescu
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap