public DataSet FindRecord(int RollNumber) { using (SqlConnection con = new SqlConnection(cs)) { DataSet ds = new DataSet(); SqlCommand cmd = new SqlCommand("spfindtblstudent", con); cmd.Parameters.AddWithValue("@RollNumber", RollNumber); SqlDataAdapter da = new SqlDataAdapter(cmd); cmd.CommandType = CommandType.StoredProcedure; con.Open(); da.Fill(ds); con.Close(); return ds; } }
public DataSet Find(int RollNumber) { DataSet ds = null; Dal objdal = new Dal(); ds = objdal.FindRecord(RollNumber); return ds; }
protected void btnfind_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); int RollNumber = Convert.ToInt32(txtid.Text); Bll objbll = new Bll(); objbll.Find(RollNumber); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { txtname.Text = ds.Tables[0].Rows[0]["Name"].ToString(); txtaddress.Text = ds.Tables[0].Rows[0]["Address"].ToString(); txtphone.Text = ds.Tables[0].Rows[0]["Phone"].ToString(); } else { Label1.Text = "No Record(s) avalilable"; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)