Jump to content
Xtreme .Net Talk

Robby

Moderators
  • Posts

    3848
  • Joined

  • Last visited

Everything posted by Robby

  1. What you can do is create the tabs at run-time, and only create the needed controls when required. (user level and such) The two methods I used above (removing tabs and disabling controls) would most likely be used if the controls were all created at design-time.
  2. you can do something like this... Private Sub ChangeControlsState(ByVal bState As Boolean) Try Dim ctr As Control For Each ctr In tabClient.Controls If TypeOf ctr Is TextBox Then ctr.Enabled = bState End If Next For Each ctr In tabLoan.Controls If TypeOf ctr Is TextBox Or TypeOf ctr Is ComboBox Or TypeOf ctr Is NumericUpDown Then ctr.Enabled = bState End If Next btnApply.Enabled = bState Catch 'ignore errors End Try End Sub
  3. you can clear the tabs... tabMain.Controls.Clear() or remove only one or more... tabMain.Controls.Remove(tabSecond) tabMain.Controls.Remove(tabFifth)
  4. As Divil mentioned... dim shs() as integer redim preserve shs(x)
  5. Can you share some of the code related to the error?
  6. It's great to hear that you have experience with them. Thanks.
  7. The one that Nerseus suggested looks pretty good.
  8. I don't have anything mission-critical, but a solid up-time and speed are needed. (Whether it's for myself or a client) Until I host the site myself, I don't mind paying $30 US/month. After all, I've been paying for four years, so what's another few months.
  9. Too good to be true? I found a free service http://dotnetplayground.com/features.aspx I'm sure they sell your name/address to everyone on the planet. (and maybe other planets as well :) )
  10. I would change the field's data type to String/Text and the code to... Dim hora As String = Now.ToLongTimeString
  11. yeah, I used http://www.webhostdir.com before. And yes, CrystalTech does host .NET.
  12. Good show Nerseus. :) They seem to have it all, and the price is fair. Here's their price comparison page for anyone who's interested...http://www.crystaltech.com/compare.htm Thanks much Nerseus.
  13. Does anyone know of any good .NET Web Hosting?
  14. or you can... Imports Microsoft.VisualBasic I would rather see SubString used.
  15. When you generate a new Primary key, do something like this... Select idField from myTable Where idField = " & intNewId If the rs returns a record the PK exists else it's ok to continue.
  16. I would do all the validation in the 'save' button.... Is the form or textbox bound to the database, or is the user just entering data on a blank form? Is the primary key generated automaticaly? And if the user 'forgot to fill in the rest of it', you should remind them as soon as they click 'save'.
  17. try this instead... The follwing assume that (in the table) - Date is a Date - Name is a string - Score is numeric - Win is numeric myConnection = New SqlConnection("server=(local);database=Pitch;Trusted_Connection=yes") Dim recordsAffected As Integer Dim InsertCmd As String = "insert into PitchRecord (Date, Name, Score, Win) values (#" & TodayDate & #", '" & team1 & "'," & team1totpoints & " , 1)" MyCommand = New SqlCommand(InsertCmd, myConnection) recordsAffected = MyCommand.ExecuteNonQuery()
  18. I still do the a lot of validation server-side, but for things like a blank text box, I prefer to alert the client right away.
  19. I also use Request.Form(), and I still use JavaScript to validate a form on the client. I use a placeholder, 2 panels and 3 labels, they are are created at runtime and hold all the data I need, sort of like a template. The CodeBehind has very little code as well, 2 functions that load and format controls, and another that receives the QueryString, then calls the approriate class. (a whole bunch of Select Cases there).
  20. I agree 100% Derek. That contract I finished last month had me doing ASP.NET and the company did not want me to use any datagrid or any databinding, so I got used to doing the HTML thing. This week I re-wrote my web site and I did exactly the same thing, I used only html tags. I put no code at all on the aspx form. I create a couple of Labels at runtime and stick all my html tags into them. I've already mentioned this in another thread, I converted 20 asp and 11 html files into 1 aspx and one vb class. Funny, I thought I was in the minority.
  21. Resetnumber is fine, just not where it's being called from. If you're using a timer, call it from the Timer_Tick event
  22. the problem is that the ValueChanged event is calling ResetNumber(), then when this function changes the value of the numberUpDown the ValueChanged event is triggeres again, you probably get stuck in an endless loop. try using a different event than the ValueChanged
  23. It should work, what is the error message? Where are you calling the ResetNumber() from?
  24. if you want only the selected item... dim var as string = ListBox1.SelectedItem this will get all selected items... Dim nCounter As integer Dim s As String For nCounter = 0 To ListBox1.Items.Count - 1 If ListBox1.GetSelected(nCounter) = True Then s = s & ListBox1.Items(nCounter) End If Next label1.Text = s this will get all items, even if they are not selected Dim nCounter As Short Dim s As String For nCounter = 0 To ListBox1.Items.Count - 1 s = s & ListBox1.Items(nCounter) Next Label1.Text = s
  25. how are you declaring it?
×
×
  • Create New...