Pizza Shop - Take Orders - Populate Text Box From Databound Combo Box?
Sep 28, 2010
got a pizza shop and the assingment is to create a application which alows the user to take a customer's order... I have a combo box filled with all of the items you can order (data from an access file)... and I need to have it so that when you select an item, it shows up in a text box below... I keep getting an error message saying you can't convert datarowview to string..
here is some
Private Sub TakeOrders_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PROJECT4DataSet.Items' table. You can move, or remove it, as needed.
Me.ItemsTableAdapter.Fill(Me.PROJECT4DataSet.Items)
End Sub
[code]....
View 3 Replies
ADVERTISEMENT
Dec 1, 2010
I got a pizza shop and the assingment is to create a application which allows the user to take a customer's order... I have a combo box filled with all of the items you can order (data from an access file)... and I need to have it so that when you select an item, it shows up in a text box below... I keep getting an error message saying you can't convert datarowview to string..
Here is some
Private Sub TakeOrders_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PROJECT4DataSet.Items' table. You can move, or remove it, as needed.
Me.ItemsTableAdapter.Fill(Me.PROJECT4DataSet.Items)
[Code] .....
View 2 Replies
Oct 12, 2009
I am trying to write a program that compute the bill for a pizza shop and I cannot figure out what I am doing wrong when I build it there are no errors but when I debug it it will not run [code]...
View 4 Replies
Feb 21, 2012
How to use a databound combo box to display one field in the drop down, and another as the combo box text on roll up? Using VS 2005... For example, I have a datatable that has 2 fields. One called "ShortDesc" and one called "LongDesc". I want to be able to see the "LongDesc" column values in the drop down on the combo box. When I make a selection, I want the text in the combo box to read the corresponding "ShortDesc" value.
[Code]...
View 4 Replies
Apr 7, 2011
Anyway I am writing a program to allow the user to enter:
-size of pizza which is a combo box (CmbSize)
-type (thin crust or standard) of pizza which is a combo box (CmbType)
-pizza choice (spicy chicken, maryland etc) using a checked listed box (ChkdListChoice)
The problem I have that will probably be simple to a lot of you who are using this language frequently is that I simply want keep a running subtotal of the users choice. So for example the user chooses 8" Spicy Chicken - 3.50, then they press the BtnAddToOrder button to output it to the Textbox (TxtPizzaChoi). When the user adds the next pizza I simply want the previous pizza price to be added to this one giving a new subtotal. I have not made the price change if the user changes the size to 12" spicy chicken, the price is still 3.50, simply because I think this could make it more difficult to me and I don't have lots of time to work on this. My declarations are not all in use and i may not need them by the way.
Heres the code:
Public Class PizzaChoices
Dim price As Decimal
Dim topping As Decimal
[CODE]...
View 2 Replies
Feb 26, 2010
i have a combo box that on form load is populated but i need to know when i click an item, i will be able to code how to populate other combo and text boxes with data about the same person.
View 2 Replies
Dec 26, 2010
I'm trying to populate a List Box or Combo Box (either or, I feel like both would be very similar in how the code is written) when you load the form. Here is what I have right now:
<a href="http://s2.photobucket.com/albums/y11/funkyfries222/?action=view¤t=ForumHelp.png" target="_blank"><img src="http://i2.photobucket.com/albums/y11/funkyfries222/ForumHelp.png" border="0" alt="Photobucket"></a>
When you first open the program it gives you a form with either a list box or combo box (not sure which one I want to use yet) and then an add button to add a name to the list. It shows the from where you enter a name and then when you add a name it adds it to a text file that I have saved onto the desktop. It keeps the names on separate lines and I want each line in the text file to be an item in a list box...
Here is the code for the first form:
Public Class frmEmployeesMeat
Private Sub frmEmployeesMeat_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
frmHours.Visible = False
[code]....
View 4 Replies
Nov 10, 2010
I have the following code to insert a record into the database [code]...
View 6 Replies
Mar 9, 2009
I have a scenario at hand which has some design discussion going on. To break it down in simple words, think about a hierarchy as such Company -----> Customer ------> Orders (ignore the details of how the orders have products etc) if I was to expose an API to work with this, what would be a better design.
a)
Dim comp As New Company
comp.GetInfo(123)
Dim cust As New Customer
cust.Name= "CustomerName"
comp.Add( cust)
b)
Dim custhand As Customerhandler
Dim cust As New Customer
cust.Name= "CustomerName"
custhand.AddCustomer(cust,123) ''123 is CompanyID
View 5 Replies
Nov 16, 2011
I am getting an error when i try to populate some combo boxes with a value, the combo box has values in and the right amount the code is getting the right number.
the error msg is "Object reference not set to an instance of an object."
View 7 Replies
Nov 9, 2011
I have a program where a user can select something from a combo box in a data grid view control. I have it so that they can add something to the combo box via input box. The new item would automatically show up in the combo box at the bottom.
Now the problem is with deletion. I have it so that a user will click delete and a dialog box will pop up with the combo box. There a user will select an item and click delete. The item deletes just fine from the db but it doesn't update the combo box on either the delete dialog box or the datagridview. The only time it shows deleted is when I exit the program and reload.
Here is my load event that populates everything.
Public Sub LoadData()
Try
Dim cmTasks As New SqlClient.SqlCommand("Select * from Tasks where Department_ID =
[Code]....
View 1 Replies
Jul 21, 2010
I have a DataGridView control that is bound to a dataset that I set up in design mode. This grid will contain addresses for a client. The relationship is 1 client to many addresses. So, when the user selects a client, I wish for this grid to populate with only the address records for that client. How do I set up in code a way for the grid to recognize this?
View 1 Replies
Jun 12, 2009
I'm attempting to bind a combo to a collection of objects:
Dim t As New TradeOrderStatus()
Dim ts As List(Of TradeOrderStatus) = t.GetStatuses
With Me.cboTradeStatus
[code]...
This works fine and I see the list of items in the combo. However when I try to set the SelectedItem of the combo to one of the items:
Me.cboTradeStatus.SelectedItem = Trade.TradeStatus
nothing happens. Trade.TradeStatus is an instance of the class TradeOrderStatus and all the necessart statuses are visible in the drop-down list. The SelectedItem remains as Nothing (or as the first item in the list if I omit the .SelectedItem = Nothing line from the binding code).
Debug.Print(CStr(Me.cboTradeStatus.Items.Contains(.TradeStatus)))
also returns false.
View 3 Replies
Apr 27, 2010
I've inherited a form that has a DataGridView that is bound to a dataadapter and it is connected to a binding source. Within the DataGridView is a combo box that is bound to its own bindingsource which basically just calls a stored proc to bring back the possible values for the dropdown combo control
With a blank new row and sometimes even with an existing row, this value for the combo box can be NULL which is a legitimate value for it if no value selected. Problem is everything is so tightly bound if the user mistakinly clicks the dropdown then a value is populated and there's no way to get back to NULL
I've tried to catch the mousecelldown event and others to try to catch this before a value is selected but the Cancel=True doesn't work - I can catch the event but don't know how to return the cell to unclicked or reset it to NULL or pre selected value if NULL I know how to at a new row with the datatable and then set the combo datasource to it and I have my null blank value but with a tightly bound control how do I add this row?
View 1 Replies
Oct 18, 2010
How to avoid getting empty fields in a databound combo box?
View 2 Replies
Feb 29, 2012
I am working on an invoicing program that based on the Northwind database.I am pulling information from a 'view' for the orders form.How do i program the customer ID field to populate with the corresponding invoiceID (already done through the view) AND when i drop down the customerID box to list all possible customers from the customers table.I have the SQL for the operation I believe the problem is that the field is bound to the orders Orders Qry 'View'.How can i accomplish both of these tasks within the same dropdown?
View 1 Replies
Oct 25, 2009
On the form load event i want to populate my ComboBox1 to display unique items directly from the DB. For that i have set the DataSource property of the ComboBox1 to the selected field. On the ComboBox1_SelectionChangeCommitted event i have set the filter for the DataSource which is working fine.
Now when i select an item from the ComboBox1 i get the filtered result in DataGridView but when i again drop down the combobox i see nothing other than the last selected item. Why is this happening? Is there a better way of populating ComboBox with the items directly from DB with default selected value as null?
View 10 Replies
Jul 31, 2008
I've got 2 seperated programs.
One is a program where you can select a product and select how many of them you want. Then the total price wil be displayedin a label. And the list of selected products will be saved in a .txt file.
The second program is an Edit program. The user can edit his selected products. Here he can change the total of a product.So if he had selected 1, he can change it to three or something. When the user clicks the button Save. The changes will besaved in the same .txt file and the total price will also be changed and displayed in program one.
Program one is compleet.Program two has problems and here i need your help:- the user can't make a change in the numbers, seems that the textbox is read-only or something. How to solve?- Then when i click save, the changed must be saved in the .txt ( i can't test this yet because no changes can't be made)- the total new price must be showed in program 1 (i think i programmed this well, but can you take a look)
Here is a part of my code of program 1:
CODE:
View 3 Replies
Apr 20, 2010
I have tested the code for the DataSet and DataAdaptor and both work fine, and as test was able to place the MaxRows variable into one of the text boxes on my form so I know thats all ok. But I am now trying to use the function below to copy the 1st cell of each row into a combo box to populate the options and comes up with a null exception error but cant get my head around it.
[Code]...
View 1 Replies
Oct 23, 2011
I'm trying to populate a combo box with some data from a xml document, but so far all i'm getting is this error message in the combo box[code]...
View 2 Replies
May 8, 2012
I am new to Visual Basic and I'm trying to make a simple combo box that automatically populates from dataset. The table is from BaseMaterial with the column Material.
View 5 Replies
Feb 15, 2012
I have a form with one combo box and text box and buttons. please refer the snapshot with i have attached.I have the following code:
My Stored Procedure for inserting the data:
/*
Name: usp_InsertBranchSetup
[code]......
View 5 Replies
Mar 12, 2009
I'm trying to populate a combo box with a dataset, this sort of works, but everything is just appearing on the same line. I think this answer might be to put the dataset into an array, then put the array into the combo box.
...problem is, I'm not sure how to do this! My code thus far is,
Dim usernameList As Array
'Retrieve usernames where player has available status
GetFilteredData()
[Code].....
View 1 Replies
Jun 22, 2010
I am currently stuck in one part of my application. I have two combo boxes that i am having the users select from. The first combo box is simply bound to a datatable. that is working properly. The second one i need to populate off another datatable after sorting out what the first one is requesting. Basically it's choosing a line number on the first box and then selecting the machine associated with that line number.[code]...
View 4 Replies
Jun 6, 2011
can someone please give me basic steps on how to hard code a combo box to display a column from a database?
View 21 Replies
Aug 15, 2011
I want to fill data in my combo box using Add range method.
cboFirst.Items.Add("Sunday")
cboFirst.Items.Add("Monday")
cboFirst.Items.Add("Tuesday")
[Code]....
This is how im filling my combo with days. i want to do the Same but by using Add Range Method.
View 2 Replies
May 1, 2011
Im trying to pooulate a combo box in vb.net 2008 with information from my access database, but I have no idea how to do thi :S im trying to get it so that the customer names from the database appear in the combo box this is as far as i've gotten for my form load.[code]
View 4 Replies
Mar 10, 2011
I am currently writing a program that needs the use of a database. At the moment I am trying to get a simple combobox working.The problem I am having is that I have never done any work with databases and VB08.I am using an access database that has the fields SMTP, Port, SSL
I want to populate a combo box with the field SMTP and from there I want 2 other labels to be filled in with the port and ssl details I was wondering a) How do I set the connection up with Visual Basic (within the database I am using MySQL to get the information) b) How do I go about populating the combo box?
View 1 Replies
Jun 17, 2010
How to populate a combo box using SQL Data Reader in DAL, BAL and UI atmosphere. Please find below my code snippets and correct me if I'm wrong anywhere in this code.
'DAL Code
Public Function PopulateComboBox() As SqlDataReader
_cnCon = New SqlConnection(_conString)
_cnCon.Open()
[Code]....
What should be the UI code? Is the code specified in DAL and BAL is correct? I knoiw how to fill the combo box with values from SQL Data Reader. But I dont know how this can be done in 3 Tier application.
View 2 Replies
Sep 1, 2010
Is there a way to populate a combox with a list of available drive letters? I've tried the following code but could not gt it to wrok.
[Code]...
View 6 Replies