cmdstr = @"SELECT UserName, FirstName, MiddleName, LastName, Phone, Email, Profession, CategoryId, ReferredBy, LeadCategoryId, BirthDate, MaritalStatus, Note
FROM Lead
WHERE (LeadId = " + LeadId + ")";
myConnection.Open();
SqlCommand cmd = new SqlCommand(cmdstr, myConnection);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
txtusername.Text = reader.GetString(0);
txtfirstname.Text = reader.GetString(1);
txtmiddlename.Text = reader.GetString(2);
txtlastname.Text = reader.GetString(3);
txtphone.Text = reader.GetString(4);
txtemail.Text = reader.GetString(5);
txtprofession.Text = reader.GetString(6);
ddlcategory.SelectedValue = reader.GetString(7);
ddlstatus.SelectedValue = reader.GetString(9);
txtbirthdate.Text = reader.GetString(10);
ddlmaritalstatus.SelectedValue = reader.GetString(11);
txtnote.Text = reader.GetString(12);
}
myConnection.Close();
}
FROM Lead
WHERE (LeadId = " + LeadId + ")";
myConnection.Open();
SqlCommand cmd = new SqlCommand(cmdstr, myConnection);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
txtusername.Text = reader.GetString(0);
txtfirstname.Text = reader.GetString(1);
txtmiddlename.Text = reader.GetString(2);
txtlastname.Text = reader.GetString(3);
txtphone.Text = reader.GetString(4);
txtemail.Text = reader.GetString(5);
txtprofession.Text = reader.GetString(6);
ddlcategory.SelectedValue = reader.GetString(7);
ddlstatus.SelectedValue = reader.GetString(9);
txtbirthdate.Text = reader.GetString(10);
ddlmaritalstatus.SelectedValue = reader.GetString(11);
txtnote.Text = reader.GetString(12);
}
myConnection.Close();
}
No comments:
Post a Comment