| | |
Relating combo boxes
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2009
Posts: 20
Reputation:
Solved Threads: 0
Can nyone tell me how to relatr combo boxes????
i hv used this code bt this is throwing exception ......ny help would be appreciated .I hv jst started wworking on c#
i hv used the following code nd i hv populated the cmbschoolcode in loading of my form
its saying no value given to one or more parameters .
i hv used this code bt this is throwing exception ......ny help would be appreciated .I hv jst started wworking on c#
i hv used the following code nd i hv populated the cmbschoolcode in loading of my form
C# Syntax (Toggle Plain Text)
private void cmbSchCode_SelectedIndexChanged(object sender, EventArgs e) { String connectionString = System.Configuration.ConfigurationSettings.AppSettings["dsn"]; DataTable dt = new DataTable(); string Query = String.Format(@"SELECT RegNo FROM Student WHERE SchoolCode ={0} ", cmbSchCode.Text); OleDbDataAdapter adapter = new OleDbDataAdapter(Query,connectionString); adapter.Fill(dt); foreach (DataRow dr in dt.Rows) { cmbStudent.Items.Add(dr[0].ToString()); } }
Last edited by Tekmaven; Jun 19th, 2009 at 3:14 am. Reason: Code Tags
•
•
Join Date: Jun 2009
Posts: 20
Reputation:
Solved Threads: 0
•
•
•
•
yes but your query is a select query, to insert something into database you should run insert query which i dont see in your code.
i hv inserted the insert query after my code but is shows exception that it will create duplicate values.i hv also tried the update query bt it also doen'nt work.....
![]() |
Similar Threads
- Making Master Detail Combo Boxes in Asp.net work without post back (ASP.NET)
- linking two combo boxes (Visual Basic 4 / 5 / 6)
- linking two combo boxes (VB.NET)
- Configuring Combo boxes (C#)
- Datagrid with Combo Boxes (Visual Basic 4 / 5 / 6)
- linking two combo boxes (VB.NET)
- Combo Boxes (Java)
- Dynamic Combo boxes JS or AJAX ?? (PHP)
- Creating a treeview from data in combo boxes (VB.NET)
Other Threads in the C# Forum
- Previous Thread: database problem
- Next Thread: How to completely Exit an application
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# cast check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener mailmerge mandelbrot math mouseclick mysql operator path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox robot save saving serialization server sleep socket sockets sql sql-server statistics stream string stringformatting table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






