Adding Customer Information To An Array?
Nov 8, 2010
I'm trying to add 3 customers to an array that I can then display in 4 seperate text boxes on my form. First Name, Last Name, Account Number and Balance.
Public Class Customer
Private firstName As String
Private lastName As String
Private accountNo As Integer
[code]....
Error 2 Argument not specified for parameter 'account' of 'Public Sub New(first As String, last As String, account As Integer, balance As Decimal)'.
View 8 Replies
ADVERTISEMENT
Nov 15, 2009
I have an application that connected to a database (SQL Server 2000) .Is there any way to send an information and Report made by Crystal reports by mail so customers can check it from his email?
View 4 Replies
May 31, 2010
I am attempting to create a program which saves customer information for a business e.g first name, last name, address etc. but i am having trouble coding the save , new, print, next/previous record buttons.
Would someone be able to link me to a tutorial which explains how to do these?
View 3 Replies
Apr 20, 2011
I have to use a northwind database to display customer and order information. Populate a combo box with the CompanyName sorted in alphabetic order. Display the customer information in bound labels and the order information in a grid. For customers, display id,name,title,phone. For orders display the order id order date required date and shipped date. how to connect the access database file to vb.
View 3 Replies
May 19, 2011
I have a problem in that I have five text boxes pertaining to a customer/client, where there is a txtbox for each: Name; Address; City: State; Zipcode. Of course all the txtboxes are "" at initialization. I also have 2 combo boxes and a 2D array for prices which I have finally been able to understand the array logic. I have also been able to do my necessary calculations for.
My problem. The customer information is first to be validated as all being strings and not empty. The combo boxes I was able to get to tie to my 2 dimentional array and get good output and calculations for a finished product. I am just having problems with the error messages. Also I don't want summary totals unless the data is valid. In other words, the user must enter a complete address and make decisions about the two combo boxes, both of which are needed to use the price array. I will change the comboBoxes to represent dress sizes,"S" "M" "L" and "XL" and the other combobox to describe colorRedSatin or colorBlackBroadcloth with a two dollar difference in price between them. 'That would be similar enough to the problem I need to solve.
Basically I do not want any numbers to appear for price of the dress or addons to the dress unless all validation is complete. I do understand how the radio objects work for discounts and check boxes for accumulating accessories. The program should not give any totals untill the user has input all customer information and made decisions about input from combo boxes and selected calculate from menu. Right now it calculates and puts zeros in when choices are not made from the combo boxes by the user. It will include correct amounts for radio buttons and checkboxes if anything is entered. I need error messages for customer inputs and combo box inputs (if not selected from list of option in drop down for choices) (basically if nothing was put in a text box, the text box is empty. Of course the problem is the user must enter something in all 5 textboxes and not get multiple error messages in rapid succession to fix. We can't always count on our users putting in good data.. When I tried a Do While False with ORs I was getting endless looping. I could not get it to work because it will never execute because the control never passes back to the user.
I don't want to list a series of If/Thens becauser the user will see about 7 messages, where he/she only needs to be fed one at the time. I hope someone can give me some direction. I just need guidance on how to validate the text boxes and combo boxes. The code is analyzed with a "Calculate" on the menustrip. I would like for the calculation not to calculate and put outputs into the summery text boxes unless all textboxes are filled and combo boxes are valid for all the customer information and combo box choices for my two combo boxes describing what is needed for the order to calculate. There are also the radiobuttons and checkboxes, DIMs, Const, Variables, but not having problems with that part I have my indexing problems on the combo boxes worked out also, so I am not concerned about those now except for getting the error messages when I should. I hope that I have described my issues fully. I am using visual studio 8 with Windows 7
View 4 Replies
Apr 12, 2009
I have a class called Customer. It has some property like custID,custName..etc. Inside Customer class I have a function which returns an array of customer.
I wrote a function like this :
Public Function InitLoadCustomerDetails() As Customer()
sql = "SELECT* FROM tblCust"
ds = classDC.queryHandler(sql, "InitCustomerDetails")
Dim customerArray(classDC.maxrow - 1) As Customer
Dim currentCustomer As New Customer
[Code] .....
But it is not returning an array. Just a customer variable??
Public Function InitLoadCustomerDetails() As Customer()
Return customerArray
End Function
Fix this to return an array of customer!!
View 10 Replies
Oct 4, 2011
I have the following problem: I select a customer from a dropdownlist and then the gridview should load all items of all orders of that customer. I have the following query:
Dim allorders = From ord In db.Orders
Where ord.CustomerID = Convert.ToInt32(CustomerDropDownList.SelectedValue)
[CODE]..............
I also tried to modify the query as follows:
Dim orderitems = From oi In db.OrderItems
Where oi.OrderNumber = (From From ord In db.Orders
[CODE]...........
But this does not work. I just started using LINQ.
View 5 Replies
Oct 5, 2011
A registeration sys using a Microsoft acres database I have a table named customer info to store customer details when registering and I need coding that will add the following to my table customer I'd , firstname, lastname , phonenumber and user also has to make selection between radio buttons male or female.
View 2 Replies
Jan 5, 2010
I am trying to autocomplete customer surnames direct from the Customer Datatable, using the code below which I got from another thread, but nothing is happening.
[Code]...
View 6 Replies
May 27, 2011
I have two form
First 1 is main form name Form1
Second 1 is Form2
i want to get label1.text from form2 into form1.textbox.text
my example code
Code:
Text1.text = Form2.label1.text
this code work if both form are show()
but i want my form2 allways Hide()
View 1 Replies
Apr 27, 2010
does anyone know how to make it that when you type something in to a text box the click a button called add to then have what you typed in added to a checked list box and then have it that when you click another button called add that the information in the checked list box which has been checked is then added to a database.would it be better to make th information entered in to the text box be saved to a text document and then have the checked box get its information from the text file if so does any one know how to do that.
View 3 Replies
Jul 21, 2010
I am trying to add exception information into a textbox and not able to successfully. I am getting an error when trying to do so.
Screen shot of code and error attached. Any ideas how I can accomplish this task?
View 4 Replies
Dec 14, 2009
In the following code example, I am querying WMI for Memory Modules and adding the information to a TreeView component.
VB.NET
Dim Scope As New ManagementScope("
ootCIMV2")
Scope.Connect()
Dim objectQuery As New ObjectQuery("SELECT * FROM Win32_PhysicalMemory")
Dim Searcher As New ManagementObjectSearcher(Scope, objectQuery)
[Code] .....
When I run the code, I expect to see a Parent Node named System Memory, and two Child Nodes for each memory module installed. I do get the appropriate Child Nodes, but I also get an extra Parent Node and I can't seem to figure out why:
View 2 Replies
Nov 28, 2009
I am not sure what I am doing with this and need some direction. I have attempted to create a stored procedure in SQL Server 2005 called proc_GetPrefixes with the following content
USE [CRM]
GO
ALTER PROCEDURE [dbo].[proc_GetPrefixes]
[Code].....
The stored procedure is supposed to get all the records and what I want to do with the result set is to add all the items to a combobox. I have started off with the following and not sure where to go with this:
[Code]....
View 4 Replies
Mar 12, 2011
Several times av been come across of the need of how to create new variables on my application while is running and the next time i will run again the application to be existed in my source code and still be inside.
what excatly i mean is for example i have a listbox with out assigne it in any databound ,or retreive any items from any textbox i just want to insert some items inside
if i go from the designer then i can succesfully add any item i want and they will be there as i declare them.but if i want to to that programmatically i will be able to add them in the listbox but the next time i will run it again it will be lost.until i will select the command again to fill my listbox which is not what i want
in my case i have a datagridview which is running SQL querys and i want if the user selects to save this query i want from some way to save this query string in my listbox . and i want to be there the next time i will run my application with out using any text file or database,
is there any way to that ? i have search before i ask but obviusly my keywords dosen't much with what i was looking for
View 4 Replies
May 30, 2010
I started programming in VB many moons ago, but I put it down about a year ago. I picked back up a project I was working on a few years ago and Visual Studio 2008 Pro had to convert it. It seemed to work just fine but I wanted to make it "look .NETish", so I simply copied all the controls and code into a new project.The new project won't display information stored in static arrays on a Rich Text Box. The arrays are declared public in a code.vb file and the array is populated in the load event for the main form.I've tried inserting a "test" button to see if I could somehow get it to display trying a few different things. Essentially:
Private Sub cmdTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdTest.Click
Dim test As String = Gems(0)
[code].....
Has array conventions changed or something in the past year or so? How do I extract the information contained in Gems() that I have so maticulously entered so long ago
View 3 Replies
Sep 24, 2009
I need to use an array at any part of the project. It has been suggested to me to build an array and show its result in a combobox. Instead of having an input textbox, i will have a combobox which will display 10 common names which are kept in the array.
'Defines the array Names
Dim names(9) As String
'Defines the array's fields[code]......
View 1 Replies
Oct 13, 2010
I'm a beginner at programming so I'm going through the Clearly Visual Basic 2008 book. There is a problem that I'm doing called JM Sales Solution and I need to create a one dimensional array with the information given.
JM Sales employs 8 salespeople. The sales manager wants an application that allows him to enter a bonus rate. The application should use the rate, along with the 8 salespeople, in an array, to calculate each salesperson's bonus amount. The application should display each salesperson's number (1 through 8) and bonus amount. as well as the total bonus paid, in the interface.
I did the interface that's not a problem. My problem is the Create Report code. I had the program running and displaying but it didn't display all eight bonuses or the Bonus and Total Bonus paid at the end. I did some tweaking and now I can't even get it to run again. This is the code I'm currently on
[Code]...
View 4 Replies
Mar 22, 2010
My button won't display the information my arrays are holding. why it won't show the information that is stored in the arrays... It shows only 'blanks' I don't understand!!!
Public Class frmMain
Dim intCount As Integer
Dim nmlStudents(49) As Namelist
[Code].....
View 4 Replies
May 13, 2012
So I have a list of book branches in an array called _branches. I need to write a procedure that adds branch names to branchNameListBox. Then I have to write a procedure that displays the information on the branch currently selected in the list box. The information should be displayed in sealPictureBox (branch image), cityLabel,nEmpLabel, and totalSalesLabel.This is what I have but the _branches are underlined in blue and it says the it cannot be indexed because there is no default property. what does that mean and how do I fix that?
Public Class BranchInfoForm
rivate branches() As BranchInfo = getBranches()
Private Sub BranchInfoForm_Load(ByVal sender As System.Object,
[code].....
View 2 Replies
Jun 7, 2010
i'm doing a program that reads a .csv file, and i want to split the 5th information to a array. But just the 5th information on every line.There is the code i have already done:
Public Class form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ofd As New OpenFileDialog
[code]....
View 2 Replies
Jan 23, 2012
I'll try to explain what i'm doing here, i wan't look through a text file, adding certain lines to an individual array element. So i want to build an array with mcode, mTitle, mCredits, mSemester, moduleStats, currentYear <--- this information as an array element. So here is my attempt at the code,
Dim sr As StreamReader = New StreamReader("datasource.txt")
Dim line = sr.ReadLine() ' get each line and store it
Dim currentYear As Integer
[code].....
View 7 Replies
Jul 2, 2009
For example, when I click on the btn(5) I would like the textbox1 says: "5"
[Code]....
View 3 Replies
Oct 2, 2011
I want to pull information from an array and place it into a chart of text boxes on the form. I have used a control array before but this time I want to create a dwo dimension control array. My guessing is not working... The display will be 10 x 10?
View 4 Replies
Apr 22, 2010
I have a list of names in a database and what i want is to get all of these names and display them in a label or a text box to the user on the website. I have tried to do this using a for loop but it is always overwriting the label each time. I have a list of 10 different names in the database and what it is doing is putting the first name in the label and then overwriting this with the second name and so on until it reaches the last name. I think i need to store each of the names from the database into an array or an arrayList and then make the label display all of the contents from the array or arrayList. The for loop i have used for this is:
Dim g As SQLadmin = New SQLadmin()
g.DB("SELECT nameOfPerson FROM Persons")
For i As Integer = 0 To g.array.GetLength(0) - 1
[code]....
i can select the names from the database and store them in an array then make the label display each of the names.
View 6 Replies
Apr 24, 2011
I am trying to add to the end of an array that is holding information that is loaded from a text file in the form load event and I am struggling.
Public Structure ProductInfo
Dim ProductID As String
Dim ProductName As String
[Code]......
View 2 Replies
Jul 27, 2010
I have this piece of code
For a As Single = 1 To Picture1.Height - 1
If a < TempArray.Length Then
' Some Stuff here that i really would love not to share
Else
[code]....
I get an error when i try to add the Array TempArray to the List of Boolean TruthBool... The Error Says QuoteObject reference not set to an instance of an object.The Variables are declared like this
Dim TruthBool As List(Of Boolean)
Dim TempArray(10000) As Boolean
I know there are a couple of other problems with this code.. and i have solved most of them in my actual program.. I just cant get this error to go away...
View 5 Replies
Feb 25, 2009
I am just starting VB at 60 years old and with no programming experience and nobody to ask for help...except here, of course. So needless to say I am hitting brickwalls. I am using "Murach's Visual Basic 2008" and it seems to be a good book. This is what I am up to I have to declare an array with 5 elements with an index. I think that part is OK. Then add code that adds each element to the next one every time a user clicks a button. I have had many tries but the best I can get is just the grand total of the elements. Here is the code I came up with:-
[Code]...
Is anyone able to show me how the button click would reveal a progressive total of the elements each time a user clicked on it? It would be good if the book came with answers or had a forum for their readers.
View 5 Replies
Jun 22, 2012
I have a multidimensional array which will hold 3 bits of value and value will be added through a loop by reading from db. When it come this line of code:
*MenuAccess(.Fields("GROUPNO").Value, .Fields("ITEMNO").Value, .Fields("SUBITEMNO").Value) = OKNO*
It's hitting error, 'Object reference not set to an instance of an object.'
Public MenuAccess(100, 30, 50) As Boolean
Private Sub RtGetMenu_Access()
Try
[Code]....
View 1 Replies
Feb 24, 2012
I am trying to run an event which will search through the different files in a given directory. The goal is to have it search for all files that begin with 'SP_', which are .sql files containing Stored Procedures. I would then like to add the full text of these Procedures to an array to be used later. This is causing an error when run, which I believe is because 'FullProcedureArray()', the string array I am trying to load does not have defined boundaries. When I declare it as 'FullProcedureArray(7)', or with some other value, it appears to run fine. But I don't want to have to hard-code a boundary for 'FullProcedureArray'; I would rather let it be defined by whatever the number of files in the folder is.
My question: Is there a way to declare 'FullProcedureArray' without having to give it an absolute value? I may just be missing something painfully obvious, but I haven't worked with this type of array much in the past.
Dim AppDataLocation As String = "C:FilesTestFiles"
Dim ProcedureArray As String()
Dim ProcedureText As String
[Code].....
View 2 Replies