It is step3 procedure
protected void btn_select_Click(object sender, EventArgs e)
{
Datac c=new datac();first f= c.search(Convert.ToInt32(TextBox1.Text));TextBox2.Text = Convert.ToString(f.name);TextBox3.Text = Convert.ToString(f.course);TextBox4.Text = Convert.ToString(f.fee);
Label1.Text = "record fetched";
}
It is step4 procedureVariable class
public class first{public int id{get;set;}
public string name { get; set; }public string course { get; set; }public int fee { get; set; }}
It is step5 procedure
public first searchmain(Int32 ss)
{
Int32 sa = ss;
string querystring= "select * from student where stu_id="+ sa;
first f = new first();
string constring = "Data Source= SHYAM-6E8C5C74B\\SQLEXPRESS ;initial catalog=college; integrated security=True "
SqlConnection cn = new SqlConnection(constring);
SqlDataAdapter da = new SqlDataAdapter(querystring,cn);
DataSet ds = new DataSet();
da.Fill(ds);
f.name = Convert.ToString(ds.Tables[0].Rows[0][1]);
f.course = Convert.ToString(ds.Tables[0].Rows[0][2]);
f.fee = Convert.ToInt32(ds.Tables[0].Rows[0][3]);
return f;
}
No comments:
Post a Comment