public DataSet ExecuteCommandDataSetReturn()
{
try
{
OpenCon();
DataSet objDS = new DataSet();
cmd.CommandTimeout = 0;
cmd.Transaction = SqlTr;
SqlDataAdapter objDA = new SqlDataAdapter(cmd);
objDA.Fill(objDS);
return objDS;
}
catch (Exception ex)
{
throw ex;
}
}
protected void Button2_Click(object sender, EventArgs e)
{
SqlDB objDB = new SqlDB();
objDB.Prepare("StoredProcedure1", CType.StoredProcedure);
DataSet ds = new DataSet();
ds = objDB.ExecuteCommandDataSetReturn();
ds.Tables[0].TableName = "TotalUser";
ds.Tables[1].TableName = "TotalComp";
Label1.Text = ds.Tables["TotalUser"].Rows[0]["totaluser"].ToString();
Label2.Text = ds.Tables["TotalComp"].Rows[0]["totalcomp"].ToString();
}
No comments:
Post a Comment