Jump to content
Xtreme .Net Talk

tehon3299

Avatar/Signature
  • Posts

    156
  • Joined

  • Last visited

Everything posted by tehon3299

  1. It must be because I am adding them to the listview from an array. You think thats it?
  2. Still won't work for some reason. Dim StringVariable As String = lvwTeams.SelectedItems(lvwTeams.Items(0).Index).Text Still getting an argumentoutofrange exception. I'm selecting one of the items in the list and clicking a button that fires this method and I'm getting that exception. I am adding them to the listview this way: Dim str(6) As String Dim itm As ListViewItem While myReader.Read() str(0) = myReader.GetValue(2) str(1) = myReader.GetValue(3) str(2) = myReader.GetValue(4) str(3) = myReader.GetValue(5) str(4) = myReader.GetValue(6) str(5) = myReader.GetValue(7) itm = New ListViewItem(str) lvwTeams.Items.Add(itm) End While Any other ideas?
  3. Why do I keep getting an ArgumentOutOfRange Exception? I am using: Dim StringVariable As String = lvwTeams.SelectedItems(0).ToString Label1.Text = StringVariable
  4. I know I can use the SelectedItems method but that returns a ListViewItem correct? And I need to know how to convert that into something that I can use, like a string.
  5. How can I get the selected index of the selected item in a listview and also get the text that is selected. I.E. I have a listbox with a bunch of teams in it and I want to get the text that is selected in the listview. Like if Yankees is selected, I want a string set to "Yankees". Any ideas?
  6. But how would I change the first column from "Item1" to whatever I am reading?
  7. OK...Now I don't know how many rows I will have since I am getting this from an SQL table. So how would I create these "items1, items2..." on the fly?
  8. I have a listview with 2 columns and I need to know how to put things in the second column. When I do a: lvwTeams.Items.Add(myReader.GetValue(6) & " (" & myReader.GetValue(2) & myReader.GetValue(3) & ")") it only puts thing in the first column. How do I do this??
  9. How do I specify each column? I can create each column, but how do I say I want this in the second coloumn and this in the third and so on?
  10. Is there still a listview control in .NET? I remember doing a: lvwMain.ColumnHeaders.Add , , "Team", 4000 in VB 6. Can I still do something like that?
  11. What should I use if I want to have a box with divided columns on a form? i.e. I want a column for Team Name, and Coach. What should I use?
  12. This is the code I am using: Dim MyCommand As New SqlCommand() Dim MyConnection As New SqlConnection() Dim MySQLDataAdapter As New SqlDataAdapter() Dim SessionCmd As String MyConnection = New SqlConnection("server=(local);database=StatKeeper;Trusted_Connection=yes") SessionCmd = "Select (TeamName) FROM tmTeams" MyCommand = New SqlCommand(SessionCmd, MyConnection) MyCommand.Connection.Open() Try MyCommand.ExecuteNonQuery() Catch Exp As SqlException If Exp.Number = 2627 Then Else End If End Try MyCommand.Connection.Close()
  13. I need to get all the items under a certain column in SQL and add them all to a Listview. How would I do this? I know how to connect to SQL and add things to listview's but I don't know how to add them when it's from SQL.
  14. OK...Thanks
  15. Thanks a lot.
  16. No, I haven't but something must still be open. How do you close a form when a button is clicked? In VB6 I used Unload Me but in .NET you can't. What should i be doing?
  17. I have a checklist box of about 9 items and I was wondering how I would go through that list for checkboxes and uncheck them all?? Anyone?
  18. How do you handle the click of the "x" in the top corner to close the application? How do you unload the application? I can do it with a button click but how do I do it with the "x"?
  19. Oh yeah...forgot about having to declare new forms in .NET. Thanks
  20. How can I show another form in my program? I.E. I am in frmMain and want to show frmTest and hide frmMain.
  21. Do I need the new method? And what does the new method do?
  22. I am just getting into writing classes with .NET and I was wondering how I would do that following? I need a class that has 3 integer number (for serial keys) and it needs to have a validate function to validate the keys. I just need help on what goes in which methods. Like what is the new() method for and do you need to have one?
  23. I was wondering how people put trial periods on their products. Obviously it's so many days or so many uses, but how do you make the serial numbers? It's an algorithm of some sort right? Does anyone have any info on this? Thanks
  24. Can you call .Dispose on any object?
  25. I realize in .NET that it garbage collects automatically when needed but I am still getting memory leaks. I have a program that acts as a Robot for the web and it gets links on pages and goes to all those pages and gets those links and so on. But my memory is getting used up little by little when I let it run for about an hour. Any ideas?
×
×
  • Create New...