Reputation: 1397
i created one ASP.Net project using SQL Server 2005 .I successfully inserted .But i dont know to view the table.Please tell me
Upvotes: 0
Views: 66
Reputation: 62157
A beginner instrudciton into SQL server seems in order - you seem to stumble around not knowing anything about hwat you really deal with.
I suggest heading over to ASP.NET (http://www.asp.net/) and read the indroduction documentation, as well as have some look at the sample code and the beginner forum.
Upvotes: 2
Reputation: 38543
Well this is a pretty broad question, but to get data into a datatable you could do something like:
DataTable dt = new DataTable();
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLConnection"].ConnectionString);
SqlCommand cmd = new SqlCommand("Retrieve", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@ID", SqlDbType.Int).Value = ID;
SqlDataAdapter sqldata = new SqlDataAdapter(cmd);
con.Open();
sqldata.Fill(dt);
con.Close();
Upvotes: 0