Guest User

Guest User

  • Tech Writer
  • 529
  • 41.1k

Select Index Chager Picture Show In Picture Box

Jun 5 2021 5:35 PM

I wan select value 1 than image load in picturebox 

This Is My Code

private void Regno_SelectedIndexChanged(object sender, EventArgs e)
{
cmd = new SqlCommand("Select *From tbl_member where [Reg No]='" + Regno.Text + "'", sqlcon);
sqlcon.Open();
cmd.ExecuteNonQuery();
SqlDataReader dr;
dr = cmd.ExecuteReader();
while (dr.Read())
{
string reg = (string)dr["Reg No"].ToString();
Regno.Text = reg;
string Dor = (string)dr["Dor"].ToString();
dor.Text = Dor;
string CNOFM = (string)dr["CodeNoOfMember"].ToString();
cnofm.Text = CNOFM;
string Name = (string)dr["Name"].ToString();
name.Text = Name;
string Cnic = (string)dr["CNICNO"].ToString();
cnicno.Text = Cnic;
string Wing = (string)dr["Wing"].ToString();
wing.Text = Wing;
string hn = (string)dr["HouseNumber"].ToString();
housenumber.Text = hn;
string DOB = (string)dr["DOB"].ToString();
dob.Text = DOB;
string DOJ = (string)dr["doj"].ToString();
doj.Text = DOJ;
string pa = (string)dr["Pressent Address"].ToString();
PressentAddress.Text = pa;
string pe = (string)dr["Previous Address"].ToString();
PreviousAddress.Text = pe;
string email= (string)dr["EMAIL"].ToString();
Email.Text = email;
string ml = (string)dr["PHONE"].ToString();
MobileLandline.Text = ml;
string ot = (string)dr["OWNER/TENANT"].ToString();
OwnerTenant.Text = ot;
string gd = (string)dr["GENDER"].ToString();
Gender.Text = gd;
string na = (string)dr["nomname"].ToString();
NomineeName.Text = na;
string nadd = (string)dr["nomadd"].ToString();
NomineeAddress.Text = nadd;
string nag = (string)dr["nomage"].ToString();
NomineeAge.Text = nag;
string nr = (string)dr["nomrel"].ToString();
NomineeRelation.Text = nr;
string remark = (string)dr["Remark"].ToString();
Remark.Text = remark;
}
sqlcon.Close();
}

 


Answers (9)