Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             DataSet ak = SqlAC.CheckData("SELECT * FROM Users WHERE Username='******'");
             TB_password.Text          = ak.Tables[0].Rows[0]["Password"].ToString();
             TB_Conforirmpassword.Text = ak.Tables[0].Rows[0]["Password"].ToString();
             TB_Email.Text             = ak.Tables[0].Rows[0]["Email"].ToString();
             TB_FN.Text             = ak.Tables[0].Rows[0]["FName"].ToString();
             TB_LN.Text             = ak.Tables[0].Rows[0]["LName"].ToString();
             TB_PN.Text             = ak.Tables[0].Rows[0]["Phone"].ToString(); DataSet ds = SqlAC.CheckData("SELECT * FROM Cities");
             TB_City.DataSource     = ds.Tables[0];
             TB_City.DataTextField  = ds.Tables[0].Columns["City"].ToString();
             TB_City.DataValueField = ds.Tables[0].Columns["City"].ToString();
             TB_City.DataBind();
             TB_City.Text = ak.Tables[0].Rows[0]["City"].ToString();
         }
         catch (Exception)
         {
             Response.Redirect("Home.aspx");
         }
     }
 }
Beispiel #2
0
    private void UDDL()
    {
        DataSet ds = SqlAC.CheckData("SELECT * FROM Cities");

        TB_City.DataSource     = ds.Tables[0];
        TB_City.DataTextField  = ds.Tables[0].Columns["City"].ToString();
        TB_City.DataValueField = ds.Tables[0].Columns["City"].ToString();
        TB_City.DataBind();
    }