karthikeyan
May 15th, 2006, 03:26 AM
hi i am newbie to this environment
i am using stored procedures.
this is my coding:
private void Page_Load(object sender, System.EventArgs e)
{
if ( ! IsPostBack )
{
SqlConnection conn = new SqlConnection("server=localhost;User ID=sa;pwd=sa;database=k");
conn.Open ();
SqlCommand cmd = new SqlCommand("EMPDETAILS",conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter myAdapter = new SqlDataAdapter(cmd);
cmd.ExecuteNonQuery();
DataSet ds = new DataSet();
myAdapter.Fill(ds,"emp");
this.DataGrid1.DataSource = ds;
this.DataGrid1.DataMember = "emp";
DataGrid1.DataBind();
}
}
here EMPDETAILS is my stored procedure name, if i run this program i couldn't retreive my records.emp is my table name.
so please tall me waht to do, i am using sql server 2000 database. so please tellm e how to get my records using stored procedures
i am using stored procedures.
this is my coding:
private void Page_Load(object sender, System.EventArgs e)
{
if ( ! IsPostBack )
{
SqlConnection conn = new SqlConnection("server=localhost;User ID=sa;pwd=sa;database=k");
conn.Open ();
SqlCommand cmd = new SqlCommand("EMPDETAILS",conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter myAdapter = new SqlDataAdapter(cmd);
cmd.ExecuteNonQuery();
DataSet ds = new DataSet();
myAdapter.Fill(ds,"emp");
this.DataGrid1.DataSource = ds;
this.DataGrid1.DataMember = "emp";
DataGrid1.DataBind();
}
}
here EMPDETAILS is my stored procedure name, if i run this program i couldn't retreive my records.emp is my table name.
so please tall me waht to do, i am using sql server 2000 database. so please tellm e how to get my records using stored procedures