Hi, I have a 2 text boxes tbox1 and tbox2 now i want to populate tbox2 when a value is entered in tbox1...how this can be done?

note: Supplier Table
tbox1: SuppilerID
tbox2: SupplierName..Should populate when supplierID is entered.

How this can be done. As I am using MSAccess db...

Please help out

Recommended Answers

All 6 Replies

use Textchanged event for first text box with autopostback property set to true.and in that event populate textbox2 values and assign.use update panel if u dont want to refresh the page up on postbacks.

no not on ASP.NET any solution on C# please...Thanks

Hi,

I have done following is this correct behavior?

    private void textBox1_TextChanged(object sender, EventArgs e)
    {

        String q = "Select SupplierName from Supplier where Supplier id=" + sender;
        textBox2.Text = textBox2.Text.ToString(q);
    }

Thanks,
Regards,

Hi I have a combo box that shows data called from a table in my database. The Combo box shows a specific field (Product Name). I then have another text box that I need to update with the price of that product that is already saved.
This is my code that I have but I am getting errors.

private void cmbProductName_SelectedIndexChanged(object sender, EventArgs e)
        {
            
            txtPPU.Text = picnmuxDataset.Tables["Stock"].Rows["Stock"].ItemArray[3].ToString();
        }

I am getting errors on this.

cmbProductName.DataSource = picnmuxDataset.Tables["Stock"];//Table data
            cmbProductName.DisplayMember = "ProductName"; //row of data
            cmbProductName.ValueMember = "ProductID";//value to be used

This is the code for my combo box.

Any help would be greatly appreciated

form_load: comboBox2.Enabled = false;
comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
comboBox2.Enabled = true;

}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.