Jump to content
Xtreme .Net Talk

BlueOysterCult

Avatar/Signature
  • Posts

    87
  • Joined

  • Last visited

Everything posted by BlueOysterCult

  1. That's fantastic!! Thank You! Do I need some sort of counter? maxCount +=1 ???? Rob
  2. Hello I need to fill combo boxes on my form at form_load - I am not sure how to do it - I know it involves a For each loop - datase table something- combobox.add.item(dataset(dataRow) I have six tables only need to use five to fill the combos. they are make(car) interiorColor exteriorColor year soldstatus. these are all derived(Children?) of the Vehicles dataSet... excuse me for my lack of knowing which these are. Any help would be appreciated R
  3. thanks Diver I have everything under control R
  4. Hello all I think I am close to finishing this project but I am getting a "lare binding" error and can't seem to resolve it - HELP? Dim myCarList As Object Dim index As Integer Dim basicCarList As BasicVehicle Dim luxuryCarList As LuxuryVehicle index = cmbCarList.SelectedIndex myCarList = myCarList(index) If TypeOf (myCarList(index)) Is LuxuryVehicle Then luxuryCarList = CType(myCarList, LuxuryVehicle) txtYear.Text = CStr(luxuryCarList.Year) txtMake.Text = luxuryCarList.Make txtModel.Text = luxuryCarList.Model txtExtColor.Text = luxuryCarList.ExteriorColor txtIntColor.Text = luxuryCarList.InteriorColor 'txtSold.Text = CType(luxuryCarList.Sold, LuxuryVehicle) ElseIf (TypeOf (myCarList(index)) Is BasicVehicle) Then basicCarList = CType(myCarList, BasicVehicle) txtYear.Text = CStr(basicCarList.Year) txtMake.Text = basicCarList.Make txtModel.Text = basicCarList.Model txtExtColor.Text = basicCarList.ExteriorColor txtIntColor.Text = basicCarList.InteriorColor End If End Sub Rob
  5. Thanks DiverDan I actually have a 1 comboBox (sorry)- I am able to display the list of cars to choose from - there are 11 in the array. Does that make a difference? R
  6. I kind of want to do something like this:(?) Public Sub FillTextBoxes(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim index As Integer '= CarArrayList(0) Dim intCurrent As Integer intCurrent = (0) If index <> -1 Then txtPrice.Text = CarArrayList(2) txtMake.Text = CarArrayList(intCurrent) txtYear.Text = CarArrayList(intCurrent) txtIntColor.Text = CarArrayList(intCurrent) txtExtColor.Text = CarArrayList(intCurrent) End If End Sub Rob
  7. Hello everyone I haven't a clue as to how ... to get a selected items "features" ie if someone selects a car from the list (ListBox) 2004 Chevy S-10 into the provided text boxes for those features. The features being air conditoining, color etc. So if I were to select the chevy.. the text boxes would list those features> the text box for air cond would have the value "true" > the text box would have the value "red" I am lost with this one. Can someone give me an idea? am I over explaining it? Thanks Rob
  8. NEVERMIND.... I got it R
  9. Hello All I am getting an error that (of course) shouldn't be there. I know this should work. the error An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.windows.forms.dll Additional information: Error creating window handle. the code Dim myCustForm As New frmCarList Me.lstBoxInventory.DataSource = CarArrayList myCustForm.ShowDialog() its landing on the last lline Rob
  10. Hello All I am trying to bind my arraylist to a combo box - I guess fill it in with the data... I do know that the file is in the array (it a csv file that was read and inputted etc.) I can see it in the output window. But I can't get it to the combo box Any ideas this is what I have so far Dim myCustForm As New frmCarList myCustForm.cmbCarList.DataSource = CarArrayList myCustForm.ShowDialog() Rob
  11. That is great information! Thank you for the effort you put into my question - I am going to work on my project today and I will let you know how it goes! R
  12. Hey everyone I am having trouble wrapping my brain of how to code a prject with inheritance polymorphism etc. I understand the concept but not the code.... I need a VISUAL representation of how to do this... 4 classes,- 3 constructors, methods, overriding etc.. any sites that are good? Again a VISUAL diagram - something help?! I am a visual person in a non visual world right now Rob
  13. Hello, I have finally got to the point of not having any errors - at least the ones that I can see. I cannot get the output I need though and I don't know why here is the code Module Inventory Sub Main() Dim warranty As String Dim CarPrice As Single Dim myNewCar As New Car(3456, "usedCar", "Chevy", "S-10", "1999", 98429652) CarPrice = myNewCar.price() Debug.WriteLine(CarPrice) warranty = myNewCar.carWarranty() Debug.WriteLine(warranty) End Sub Public Sub New(ByVal originalCost As Single, ByVal category As String, ByVal make As String, ByVal model As String, _ ByVal year As String, ByVal vin As Long) dealerPrice = originalCost Me.category = category Me.make = make Me.model = model Me.year = year Me.vin = vin Public Function price() As Single If category = ("usedCar") Then stickerPrice = dealerPrice * usedGouge ElseIf category = ("basicCar") Then stickerPrice = dealerPrice * basicGouge Else stickerPrice = dealerPrice * luxuryGouge End If Return stickerPrice End Function I believe that is all the code necessary here to show yuo all if not let me know9 the warranty is fine for the output - I get the price in the output but not the rest like model-Honda Thanks Rob
  14. Hello All I am back!! I can't seem to figure the message I am getting - "Argument not specified for parameter" I think I have been looking at it too long. Anyway it concerns "vinId" Public Class Car Public ColorInterior As String Public ColorExterior As String Private BasicPrice As Decimal = 0.07 Private StickerPrice As Decimal Private DealerPrice As Decimal Private Const UsedPrice As Decimal = 0.05 Private Const LuxuryPrice As Decimal = 0.11 Public category As String Public warranty As String Public make As String Public model As String Public year As String Private vin As Long Private vinId As Long #Region "Constructor" Public Sub New(ByVal DealerPrice As Decimal, ByVal originalPrice As Decimal, ByVal category As String, ByVal make As String, ByVal model As String, ByVal year As String, ByVal vin As Long, ByVal vinId As Long) DealerPrice = originalPrice Me.category = category Me.make = make Me.model = model Me.year = year Me.vin = vin Me.vinId = vinId End Sub #End Region #Region "Method" Public Function price(ByVal amountCar As Decimal) As Decimal If category.Equals("usedCar") Then StickerPrice = Math.Round(DealerPrice * UsedPrice) ElseIf category.Equals("basicCar") Then StickerPrice = Math.Round(DealerPrice * BasicPrice) Else : category.Equals("luxuryCar") StickerPrice = Math.Round(DealerPrice * LuxuryPrice) End If Return StickerPrice End Function Public Function carWarranty(ByVal warrantyCar As Decimal) As Decimal If category.Equals("usedCar") Then warranty = "1 -year, 1,000 miles" ElseIf category.Equals("basicCar") Then warranty = "4-year, 40,000 miles" Else : category.Equals("luxuryCar") warranty = "5-year, 50,000 miles" End If Return warranty End Function #End Region End Class the Module Imports System Module Inventory Sub Main() Dim CarPrice As Decimal Dim myNewCar As New Car("Used", "honda", "Accord", "1999") CarPrice = myNewCar.price() Debug.WriteLine(CarPrice) End Sub End Module it is giving me the error in the Module at "myNewCar" Rob
  15. IS it safe to use Add/Remove - there isn't an uninstall R
  16. I don't remeber how I installed it THere are no options for anything C# related R
  17. Hello, I need to create a console C# project in Visual Studio.NET but don't have the option(s) in the project types window. WHy is this? Can someone help? If I am in the wrong place (I can't find another) can soemone point me in the right direction? Rob
  18. The user is picking the dates? I have a similar menu item on in a program I am doing... I have a Cd Colletiong that the user can "filter" by year title etc they choose this via a menu item By Year it is something like: Private Sub mnuByYear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuByYear.Click Dim strSQL, strYear As String strYear = InputBox("Please enter a year to search" & vbNewLine & "Please use the format: 1984-1987") strYear = strYear.Replace(" ", "") 'removes the spaces from the input Dim ArrYear() As String = strYear.Split("-"c) ' this would divide the string based on the - so you will have two resulting strings '(which are the two years inputted by the user) 'Now ArrYear(0) contains the first year 'ArrYear(1) contains the second year strSQL = "select CdArtist,CdTitle, CdYear,CdKey,CdCategory from Cds where CdYear between " & ArrYear(0) & " and " & ArrYear(1) 'ORDER BY CdYear OleDbSelectCommand1.CommandText = strSQL DbCdCollection1.Clear() OleDbDataAdapter1.Fill(DbCdCollection1) UpdateCounter() End Sub is this what you mean? (some credit going to Mehyar) Rob
  19. Do you mean in the database itself? We talked about that and our teacher said that since we used the Wizard to connect the dataadapter etc... that sometimes it does not do that properly especially if we delete a record which is one of the menu items I have - he said we shoud put it in the code as in the above. thanks ROb
  20. Hello All I have a CD collection program that the user can click through a list(database) of CDs - I have some filters that the user can choose also ie "By Title" - I would also like to have an Add menu item which I started but the problem is that on of the fields in the database (CdKey) is one that the user should not worry about but is crucial that I update it or add one(1) to the last CDkey number ie their are 100 records lets say and obviously the CDkeys are 1-100. How do I include this in the add code? Private Sub mnuAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAdd.Click BindingContext(DbCdCollection1, "Cds").AddNew() ' CDKEY= SOMETHING HERE?????? UpdateCounter() End Sub my fields are:CdArtist,CdTitle, CdYear,CdKey,CdCategory Thanks Rob
  21. How do you mean? Insert into - just off the top of my head... is that what you mean? R
  22. Hello everyone I have a program that is a CD collection - the user can browse through "my CD collection" - with a next and previous button. The user can even sort through them via a (menu)filter by Type (pop/rock) etc. I would like to put an option for adding a cd or removing one. I am clueless of how to do this. Can anyone Help? Here: is the code for one of the filters so you a have an idea of what I am doing Private Sub mnuByArtist_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuByArtist.Click Dim strArtist As String, strSQL As String strArtist = InputBox("Please enter a artist to search") strSQL = "select CdArtist,CdTitle, CdYear,CdKey,CdCategory from Cds where CdArtist like '%" & strArtist & "%'" OleDbSelectCommand1.CommandText = strSQL DbCdCollection1.Clear() OleDbDataAdapter1.Fill(DbCdCollection1) UpdateCounter() End Sub Thanks Rob
  23. When I put in the InputBox something like 1989 - 1992 which should only give me those dates.. I get ALL dates no sorting filtering of any kind here is a filter that works Private Sub mnuByTitle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuByTitle.Click Dim strTitle As String, strSQL As String strTitle = InputBox("Please enter a title to search") strSQL = "select CdArtist,CdTitle, CdYear,CdKey,CdCategory from Cds where CdTitle like '" & strTitle & "%'" OleDbSelectCommand1.CommandText = strSQL DbCdCollection1.Clear() OleDbDataAdapter1.Fill(DbCdCollection1) UpdateCounter() End Sub Rob
  24. I looked at it in Access and the filed says Number R
×
×
  • Create New...