Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2007, 09:27 PM
Registered User
 
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default New some help with combo box

Good morning everyone. I just join this forum a few minutes ago. I'm very new with .Net. Currently i'm learning how to use vb.net, i'm using visual studio .net 2003 and mircosoft sql.

Currently i'm doing a window application. In my form there are 1 combo box (reparea) and two textbox (repdivision and repregion). What i wanted to do is when i select an item in the combo box (reparea), the two textbox will auto fill in data.

thank in advance

 
Old April 22nd, 2007, 09:59 AM
Authorized User
 
Join Date: Mar 2007
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I will suggest..
Do all formality for the SqlConnection cn;
and write the following code on
comboBox1_SelectedIndexChanged event
{
cmd = new SqlCommand("Select repdivision, repregion from table where reparea ='"+reparea.Text+"'",cn);
Sqldatareader dr ;
dr = cmd.ExecuteReader();
while(dr.Read())
{
      textBox1.Text = dr["repdivision"].ToString();
      textBox1.Text = dr["repregion"].ToString();
}
}






Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate a text box from a combo box value dnf999 Access VBA 7 February 6th, 2012 02:24 PM
Combo box to display items from parent combo box Gini Visual Studio 2008 0 June 18th, 2008 12:30 AM
Count in combo box(display results in text box) mboyisis Access 4 April 4th, 2008 07:08 AM
Combo box choice creating filtered combo box stevensj5 Access 11 September 13th, 2007 11:33 AM
Populate List Box by Combo Box Selection mmcdonal Access 2 June 15th, 2004 12:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.