DataTable

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2006
Posts: 24
Reputation: sravankolla is an unknown quantity at this point 
Solved Threads: 0
sravankolla sravankolla is offline Offline
Newbie Poster

DataTable

 
0
  #1
May 5th, 2006
Hiii I got a error while working with datatables...

The code and Error Are Given below


DataSet ds;
SqlDataAdapter da;
ds=new DataSet();
da=new SqlDataAdapter("Select * from emp",cn);
da.Fill(ds,"emp");
DataTable dt;
DataRow drr;
dt=ds.Tables("emp");



c:\inetpub\wwwroot\CSExs\MoveRec.aspx.cs(109): 'System.Data.DataSet.Tables' denotes a 'property' where a 'method' was expected



Please Help me....

Sravan...
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: DataTable

 
0
  #2
May 5th, 2006
Why bother with the DataSet if you just want a DataTable then just do this:
  1. SqlDataAdapter da;
  2. da=new SqlDataAdapter("Select * from emp",cn);
  3. DataTable dt;
  4. da.Fill(dt);
  5. DataRow drr;
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 24
Reputation: sravankolla is an unknown quantity at this point 
Solved Threads: 0
sravankolla sravankolla is offline Offline
Newbie Poster

Re: DataTable

 
0
  #3
May 6th, 2006
Originally Posted by hollystyles
Why bother with the DataSet if you just want a DataTable then just do this:
  1. SqlDataAdapter da;
  2. da=new SqlDataAdapter("Select * from emp",cn);
  3. DataTable dt;
  4. da.Fill(dt);
  5. DataRow drr;
Thanks a lot Mr.hollystyles

Sravan...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC