Click here to Skip to main content
15,914,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have 2 combo-box :

1st combobox will show the teacher's name and the 2nd combo box will show all the subject that this particular teacher teach ,my problem is I don't know how to program it using ado.net (VB.NET) please help me in coding this scenario :)

Its for windows and please give me some sample code about it
thanks
Posted
Updated 19-Nov-11 6:11am
v2
Comments
Uday P.Singh 19-Nov-11 10:51am    
what are you trying to program?
Sander Rossel 19-Nov-11 12:12pm    
Please, next time you want to add something use the "Improve question" button.
Don't make an answer that is an update to your question.

The functionality you are looking for is called cascading dropdown

Using CascadingDropDown with a Database[^]

You didn't specify if this were Web or Windows but the technique is the same, just applied differently in each.
 
Share this answer
 
Comments
lyn10 19-Nov-11 12:18pm    
hi do you have vb.net sample? you give me ajax?
[no name] 19-Nov-11 13:24pm    
Try searching. There are many, many examples but as I said the technique is the same
double click on combox on which you want to query .... and there write querty with with connection and in query write like -- WHERE field=" & ComboBox1.text & "....


try this u wil get the thing....
 
Share this answer
 
Actually MSDN has quite some articles on ADO.NET which can tell you more than anyone here could fit it an answer.
So I suggest you start reading there and come back here if you get stuck on a subject or piece of code.
ADO.NET Overview[^]

Command Object, for executing queries:
IDbCommand (the base Interface for all DbCommand Objects)[^]
DbCommand (basic Implementation of IDbCommand)[^]
OleDbCommand (an Implementation of IDbCommand, Inherits from DbCommand)[^]
SqlCommand (Command to use when working with SQL)[^]

For parameterized queries:
Derivatives of IDbDataParameter[^]

Other Objects you will need:
Derivatives of IDbConnection[^]
Derivatives of IDataAdapter[^]

How to's:
Complete code samples[^]
Walkthough: Displaying hierarchical data in a TreeView (for example teacher - classes)[^]

Give a man a fish and he will eat for a day, teach him how to fish and he will eat for a lifetime (or something).
Good luck! :)
 
Share this answer
 
Comments
lyn10 19-Nov-11 12:11pm    
thank you :) bless you more :)
Sander Rossel 19-Nov-11 12:14pm    
Thanks. Glad it was of help to you.
Sample code is provided in some of the articles :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900