Users Pricing

forum

Home Forums Bind column value to a TextBox – MindStick

Bind column value to a TextBox

Anonymous User 2261 14 Nov 2013

I would like to bind the value returned from a SQL Query to a Text Box:

 protected void
cmbPujaName_SelectedIndexChanged(object sender, EventArgs e)
    {
        string pujaselectedid = null;
        pujaselectedid = cmbPujaName.DataValueField;
        SqlConnection con2 = null;
        con2 = new SqlConnection(ConfigurationManager.ConnectionStrings["SRKBSDB"].ConnectionString);
        SqlDataAdapter pamt = new SqlDataAdapter("select Amount from PoojaDietyMaster where PoojaDietyMasterID =" + cmbPujaName.DataValueField, con2);
        DataSet pamtds= new DataSet();
        pamt.Fill(pamtds);
        //cmbPujaName.DataSource = pamtds;
        txtAmount.Text= pamtds -- Not sure what to add here
        txtAmount.DataBind();
    }

Please help


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md