VB.NET - display the numbers in combobox
Asked By goldy gupta
02-Sep-10 01:15 AM
hello to all i am making an vb.net windows application..
i have two combo box one is of reserved seats and another of available seats
now in reserved seat combo box the values are coming from database(maximum seats are 50)
suppose seat no. 5 and 8 are reserved...now i want that the remainning seats rxcept 5 an8 should come in available combo box
how it will happen..please help
thanks in advance
Santhosh N replied to goldy gupta
You could have a column in the table to mark the reserved seats with some flag and while showing in the dropdown, in the query have the flag condition not to include reserved seat numbers..
Venkat K replied to goldy gupta
Helo gupta
This logic you need to maintain in the database. You can add a new columns booked in the table so that you can update it with a value 0/1 based on the booking status.
Support as per your example if 5 and 8 are booked then the data in the database should be as below:
(here in booked
0-refers not booked
1 - refers booked
SeatNo. Booked
1 0
2 0
3 0
4 0
5 1
6 0
7 0
8 1
So when you are retieving values in the first combobox then you need to fetch the values using the below query
SELECT SeatNo FROM tblSeats WHERE Booked=0
So this query will return only the empty seats. When a seat is booked you need to update the booked column value with 1 as below:
UPDATE tblSeats SET Booked=1 WHERE SeatNo=@seatnumber
Hope this helps you!
Thanks

types? (B) What is concept of Boxing and Unboxing ? (B) What is the difference between VB.NET and C#? (I) what is the difference between System exceptions and Application exceptions? (I)What are different properties provided by Object-oriented systems? (B) How can we achieve inheritance in VB.NET? (I) what are abstract classes? (B) What is a Interface? (A) What is difference between prevent a class from overriding? (I) what is the use of “Must inherit” keyword in VB.NET? (I) Do interface have accessibility modifier. (A) What are similarities between Class and structure? (A between Class and structure’s? (B) What does virtual keyword mean? (B) What are shared (VB.NET) / Static(C#) variables? (B) What is Dispose method in .NET? (B) What is the use
Retrieve to a text box Hi I'm totally beginner to VB.net, i'm trying write a Select query, cmbi_code change Event I_name.text = ("select i_name from is when we selecting item code, item name should come to the Item Name text box. anyone please help me to do this. Hi, Use the below code conn = New SqlConnection Connection Closed" ) End Try hi, you need to use ado.net command to connect the database in vb.net here is the code for you 1. mycommand.Commandtext = "Select i_name FROM New_item WHERE I_code in your table? If yes, then no need to write the code for insert the values in your application. Just remove that line and run up the application. Hope this will
Multiple Combo Box Selection Hey Guys, I'm new to VB.NET and looking for some help with combo boxes. I was wondering if it is possible to link 2 combo boxes to each other based on user selection? Example: Table 1 - Dept Dept ID (PK Section ID (PK) Section Name If the user selects Dept Name "Bakery" from the first combo box the second combo box should fill with the appropriate Section Name i.e. "Bread", "Cakes
combobox in vb net i need a drop down in a form, but i would also like to be if there are items as m, ma, mahe, mahesh, monika, amit, a, aa in the combobox then when i type in the combobox string 'm' then either all the itmes should b shown with focus on 'm' or u got my point, i need this soon thx in advance. http: / / www.thecodeproject.com / vb / net / autocomplete_combobox.asp http: / / www.gotdotnet.com / Community / UserSamples / Details.aspx?SampleGuid = 30138e02-c2c3-41cd-bc6a hi suneetha, wat u have given was in asp.net but i needed it in vb.net, and i want is that when the user types in a string in a
How do you bind text boxes? Help I have a combo box that is bound to an odbc data source through calling it through the app. I text boxes fill in the rest of the data based on the choice from the combo box. I'm having problems binding the txt boxes to the odbc data source. Any help ll post those here. As I recall, however, databinding does not refer to updating the database - it's not the database that gets updated but the datasource which is a RAM object (a .Net object) such a datagrid, user-changes to the data update the underlying datatable (as datasource), not the database itself. You have to write additional code (quite a bit of it in some cases) to update the database when the user clicks your Update button located somewhere on your form. Anyway, the following