-----------------------------------------------------------

New Message on cochindotnet

-----------------------------------------------------------
From: DeepakG_MSFT
Message 2 in Discussion

Hi Sujay,   A bit curious here - why not just use the SqlDataAdapter's Fill method to 
directly populate a DataSet. You can then use the DataTable collection of the DataSet 
to directly lay your hands on the DataTable. Also you can use DataSet's WriteXml 
function to output the DataSet (and the DataTable(s) it contains) as XML... (If a 
query returns multiple resultsets aka tables, you'll get a table correspoding to each 
resultset).   Here is a little snippet:      strConn = "data source=localhost;user 
id=whatever;password=whatever;initial catalog=mymanager";
   SqlConnection objConn = new SqlConnection(strConn);    //Create command to be 
executed against data source
   strSQL = "select * from authors order by au_fname";
   SqlDataAdapter objCommand = new SqlDataAdapter(strSQL ,objConn);
   
   //Create and fill a dataset
   DataSet objDS = new DataSet();
   objCommand.Fill(objDS);    Response.ContentType = "text/xml";
   objDS.WriteXml(Response.OutputStream);
 Hope this helps, 
Cheers, Deepak  

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/cochindotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to