Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <RegistrationFormHtml5.Entities.User> users = (List <RegistrationFormHtml5.Entities.User>)Session["users"];

            UserDetails.DataSource = users;
            UserDetails.DataBind();
        }
 protected void Button1_Click(object sender, EventArgs e)
 {
     using (SqlConnection sqlcon = new SqlConnection(connectionString))
     {
         sqlcon.Open();
         SqlDataAdapter sqlDa = new SqlDataAdapter("select * from Userreg where Vehicle1 = '" + TextBox1.Text + "'", sqlcon);
         DataTable      dtb1  = new DataTable();
         sqlDa.Fill(dtb1);
         UserDetails.DataSource = dtb1;
         UserDetails.DataBind();
     }
 }
Пример #3
0
    private void LoadUserInfo(string UserID)
    {
        try
        {
            string          ConnectionString = WebConfigurationManager.ConnectionStrings["YahooCon"].ConnectionString;
            MySqlConnection viewTemplate     = new MySqlConnection(ConnectionString);//explisionremoteEntities{0}", Request.QueryString["ID"]);

            string query = String.Format("SELECT Email,Username FROM Users WHERE UsersID='" + UserID + "'");
            using (MySqlDataAdapter viewTemplateSet = new MySqlDataAdapter(query, viewTemplate))
            {
                DataSet viewDSet = new DataSet();
                viewTemplateSet.Fill(viewDSet);

                UserDetails.DataSource = viewDSet;
                UserDetails.DataBind();

                //UserName.Text = viewDSet.Tables[0].Rows[0]["Username"].ToString();
            }
        }
        catch (Exception ex)
        {
            Response.Write("<br>Error: <br>" + ex.Message);
        }
    }