Jump to content
Xtreme .Net Talk

Derek Stone

*Gurus*
  • Posts

    1910
  • Joined

  • Last visited

Everything posted by Derek Stone

  1. IsDate() is a Visual Basic .NET function. You can find its documentation under the language and reference portion of the .NET SDK. I'm guessing it's a mapping to System.Convert or Date.Parse(), using a method similar to yours, above.
  2. You should take a shot at the method TechnoTone mentioned above, before you go ahead with doing it manually. But yes, what you're doing is beyond the ordinary. I'd strongly suggest organizing your data input methodology differently, either using a tabbed dialog control or a ListBox menu/panel system. Nowhere in a professionally designed business application will you see TextBoxes doing what you're having them do. It's fine, and it might work for you, but it is not the standard.
  3. That code block can (and does) work fine. I just verified it, so I don't know what to tell you.
  4. Pass a section name and a key to ConfigurationSettings.GetConfig(). NameValueCollection oConfiguration = ConfigurationSettings.GetConfig("ApplicationSettings") as NameValueCollection; [edit]You don't need to pass a key, that's done once you have the NameValueCollection[/edit]
  5. Could you use a ListView instead? The ListView supports columns intuitively, while the ListBox does not. Take a look at it in your toolbox and let us know.
  6. The problem is he's also resizing (and from what I can tell moving) the TextBoxes, meaning that a panel would only partially work. Then again, I'm not sure I completely understand what he's trying to do, so you might have hit the nail on the head. *Shrug*
  7. The following will link the assembly containing your module to the ASP.NET page DLL as it's compiled: <%@ Assembly Name="MyAssembly" %>
  8. You're going to have to do it manually, since the repositioning and resizing you're attempting is rather awkward.
  9. Actually, my above statements assumed too much. I attempted to input null (Nothing) and empty (String.Empty) values and the function still returned correctly. I have a feeling that your problem is elsewhere, possibly in that surrounding block of code. If you could post the remainder of your code I'd like to look it over.
  10. Make sure that the entered string isn't null or equivalent to the String.Empty field. Other than that, that line of code shouldn't be giving you any problems.
  11. The horizontal rules in the code blocks ([vb], [cs], [code]) aren't displaying correctly in browsers other than Internet Explorer. Not suprisingly this is due to attribute assumptions that IE makes on a regular basis... Regardless, changing the the <hr>'s to the following will fix the problem: <hr style="width: 100%;" /> Thank you.
  12. Try 'Place code here that may cause an exception Catch e1 As ArgumentException 'Handle all exceptions that are of type "ArgumentException" Catch e2 As ArgumentNullException 'Handle all exceptions that are of type "ArgumentNullException" Catch e3 As FileNotFoundException 'Handle all exceptions that are of type "FileNotFoundException" Catch e4 As Exception 'Handle all other exceptions that weren't specifically handled above End Try Of course the type of exceptions are going to differ depending on the type that might be thrown, so make sure to customize each Try/Catch block for the code it contains. The ones I listed above were the first to come to mind, and are definately not appropriate for all situations.
  13. Not that easily, however. Takes a few dozen lines of code, at best. Of course you can head over to Google and find a class that does it for you, but hey, most people can't even find their car keys, nevermind something on the *gasp* internet. One of us should put a ping class on the list of things to add to the Code Library.
  14. I suggest you take a look at the Anchor and Dock properties which are available for each control on your form.
  15. Actually that's one of the little known features, since the Access interface doesn't allow the user to input them directly, for whatever reason. Thanks for reminding us about that, Robby.
  16. With Microsoft Access? No, I don't believe so, nor would it even be practical. Access is made for personal use, and wasn't designed to support transactions.
  17. One of the largest problems I see is the lack of array redimensioning. YC(Row) = xlsheet.Cells(Row, 7).value In the above, you're making an assignment to an array element that doesn't exist. You'll need to use Visual Basic's ReDim statement to add (or remove) elements to and from an undimensioned array. You're also assuming that the Value property of a cell object will return data in the double format. Make to use Double.Parse() instead of assuming that .NET can make that leap.
  18. I wouldn't consider it good practice at all. One of the key points to look at when you normalize a database is to ensure that data isn't replicated in multiple locations, which is what you'd be doing here. I see no reason why your boss can't select the data from the primary table, where it should legitimately reside.
  19. Yes, it can. Create your code-behind in such a fashion that it can easily be customized by any page that derives from it. Then, use the Page directive's Inherits attribute to obtain the code-behind's functionability on each page in question. <%@ Page Inherits="MyNamespace.MyClass" %>
  20. http://www.freevbcode.com/ShowCode.Asp?ID=4666
  21. I'd use the following instead, to avoid error handling at all costs: private bool IsInt(string sTest) { if (System.Text.RegularExpressions.Regex.IsMatch(sTest, @"\d")) { return true; } }
  22. Dim t As TextBox t = CType(ctrl, TextBox) t.Text = "foobar"
  23. How do you go about doing it? With a little bit of help from the Marshal and MarshalAsAttribute classes found under System.Runtime.InteropServices. If you post a Visual Basic 5/6 example we should be able to convert it to .NET for you.
  24. In case anyone is interested you can learn more about platform invoke and the Win32 API in the following article: http://www.elitevb.com/content/01,0075,01/
  25. Turn server-side validation on and validate the input text using the System.Text.RegularExpressions.Regex class.
×
×
  • Create New...