Click here to Skip to main content
14,664,481 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi gurus plz give me the answer.
Posted

Rate this:
Please Sign up or sign in to vote.

Solution 1

Try This...
SqlConnection con = new SqlConnection("Data Source=(local);Database=UrDatabaseName;uid=sa;pwd=sa");

con.Open();

string Query = "Select * from Employee";

SqlDataAdapter da = new SqlDataAdapter(Query, con);

DataTable DT = new DataTable();

da.Fill(DT);

GridView2.DataSource = DT;
GridView2.DataBind();
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

Read about ADO.NET here and it will help you.

Look at these:
MSDN: ADO.NET[^]
MSDN: Accessing Data with ADO.NET[^]

The C# Station ADO.NET Tutorial[^]
Using ADO.NET for beginners[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100