Inside SQL Server, build a stored procedure in your catalog.
Create Procedure [DBO]. [Userprocedure] AS
SELECT * from [user]
Go
Call in ADO.NET
Private Void Page_Load (Object Sender, System.EventArgs E)
{
SqlConnection Con = New SqlConnection ();
Con.Connectionstring = "Workstation ID = overmind; packet size = 4096; user ID = sa; password = sa; data source = overmind; persist security info = false; initial catalog = wztj;
C.Open ();
Sqlcommand cm = new SQLCOMMAND ("UserProcedure", CON;
DataSet DS = New Dataset ();
SqlDataAdapter ad = New SqlDataAdapter (cm);
Ad.fill (DS, "User");
DataGrid1.datasource = DS;
DataGrid1.databind ();
// put user code to initialize the page
}
:) is so simple