Visual Studio 2010 using datatable [Resolved]

Posted by Anweshabhowmick under ASP.NET on 11/25/2010 | Points: 10 | Views : 10111 | Status : [Member] | Replies : 6
Can any one tell me how datatable cane be used in visual studio 2010?

Is it the code same as the 2008......in 2010 i can not find the datatable or data set in ado.net when i using the data Adapter.........

Pls any one help me.its very urgent...........




Responses

Posted by: Ganeshji on: 12/10/2010 [Member] Starter | Points: 50

Up
0
Down

Resolved
using System.Data; //(used for DataTable)
using System.Data.SqlClient;
Hope these spellings will solve ur problem.

Keep posting in dotnetfunda.

Regards,
Ganeshji

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

Posted by: Vuyiswamb on: 11/25/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
The Datatable and the Dataset has not changed. The reason why you cant see them is that you did not import the namespaces. In your usings add this

using System.Data; //This will allow you to use a Datatable
using System.Data.SQLClient;

Thank you for posting at Dotnetfunda

Vuyiswa Maseko




Thank you for posting at Dotnetfunda
[Administrator]

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

Posted by: Anweshabhowmick on: 11/25/2010 [Member] Starter | Points: 25

Up
0
Down
can i use it.................in Visual Studio 2010

Using System.Data;
Using System.Data.SqlClint;

SqlConnection con = new SqlConnection();
con.Open();
SqlCommand cmd= new SqlCommand("Select * from Tble1",con);
SqlDataAdapter da= new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource=dt;
GridView1.DataBind();
con.close();


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

Posted by: Gokul on: 12/8/2010 [Member] Starter | Points: 25

Up
0
Down
check down the speelings of system files as sqlclient. after changing that use it. It will work. It is same as the VS2008.

Thanks and Regards,
GokulNath Nithy.

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

Posted by: Gokul on: 12/10/2010 [Member] Starter | Points: 25

Up
0
Down
got the answer? Is it working now?


Thanks and Regards,
GokulNath Nithy.

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

Posted by: Anweshabhowmick on: 12/16/2010 [Member] Starter | Points: 25

Up
0
Down
Thank u mam.for helping.........How r u?

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

Login to post response