Data table

Posted by Adnan under Sql Server on 7/9/2009 | Views : 1699 | Status : [Member] | Replies : 2
public static DataTable getTAble()
{
DataAdapter da=new DataAdapter(q,con);
DataTAble dt=new DataTable();
da.fill(dt);
return dt;
}

what is right the above coding? I have confused because the fill method is used to fill the data into DataSet.but the above code the fill method is used to fill the data into DataTable. pls answer this problem




Responses

Posted by: Raja on: 7/9/2009 [Member] Starter

Up
0
Down
Fill method can fill DataSet and DataTable both.

So your code should work fine.

Regards,
Raja, USA

Adnan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rengan on: 7/9/2009 [Member] Starter

Up
0
Down
Hi,
no error in your code more reference about fill methods check this link
http://authors.aspalliance.com/aspxtreme/sys/data/common/DataAdapterClassFill.aspx

Adnan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response