private void BtnGet_Click(object sender, EventArgs e)
{
string str1 = string.Empty;
try
{
str1 = "select * FROM Registration WHERE SNO='" + TxtSno.Text + "'";
con.Open();
da = new SqlDataAdapter(str1, con);
da.Fill(ds);
TxtName.Text =ds.Tables[0].Rows[0][1].ToString();
TxtGender.Text=ds.Tables[0].Rows[0][2].ToString();
TxtDob.Text =ds.Tables[0].Rows[0][3].ToString();
TxtAge.Text =ds.Tables[0].Rows[0][4].ToString();
}
catch (Exception ex1)
{
MessageBox.Show(ex1.Message);
}
finally
{
if (con != null)
{
con.Close();
}
}
}
{
string str1 = string.Empty;
try
{
str1 = "select * FROM Registration WHERE SNO='" + TxtSno.Text + "'";
con.Open();
da = new SqlDataAdapter(str1, con);
da.Fill(ds);
TxtName.Text =ds.Tables[0].Rows[0][1].ToString();
TxtGender.Text=ds.Tables[0].Rows[0][2].ToString();
TxtDob.Text =ds.Tables[0].Rows[0][3].ToString();
TxtAge.Text =ds.Tables[0].Rows[0][4].ToString();
}
catch (Exception ex1)
{
MessageBox.Show(ex1.Message);
}
finally
{
if (con != null)
{
con.Close();
}
}
}
No comments:
Post a Comment