Results 1 to 36 of 36

Thread: [RESOLVED] Calling a Sub in a Different aspx.vb File

Hybrid View

  1. #1
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Calling a Sub in a Different aspx.vb File

    Hey,

    What database are you using? SQL Server? MySQL?

    Each database is different.

    You can do it through a SQL Query as defined here:

    http://www.w3schools.com/Sql/sql_autoincrement.asp

    But it's easier to do this in a database IDE, such as SQL Server Management Studio.

    That's just it though, doing it using wizards, datasources, etc, means that you are limited in what you can actually do. For instance, the only thing you might be able to do is this:

    http://www.15seconds.com/issue/030102.htm

    However, if you implement it in code, you have far more control over the exception handling.

    Gary

  2. #2

    Thread Starter
    Member
    Join Date
    Dec 2009
    Posts
    37

    Re: Calling a Sub in a Different aspx.vb File

    What I need to do is not only prevent the user from entering a null value, or one that cannot be contained by the datatype used, but also prevent passable yet incorrect values from being placed into my SQL Server Database. For instance, the format feild should only contain either a "VHS" or a "DVD" value... but a user could still enter "VH", or "vhs", which would cause problems for processing later on. How can I define and throw an exception for this kind of issue?

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Calling a Sub in a Different aspx.vb File

    Quote Originally Posted by jwesleycooper View Post
    What I need to do is not only prevent the user from entering a null value, or one that cannot be contained by the datatype used, but also prevent passable yet incorrect values from being placed into my SQL Server Database. For instance, the format feild should only contain either a "VHS" or a "DVD" value... but a user could still enter "VH", or "vhs", which would cause problems for processing later on. How can I define and throw an exception for this kind of issue?

    Then don't give them the choice. Use a dropdownlist so that they can pick from a list of predetermined values, that's the purpose of DDLs - to get the user to pick from a specific list rather than typing it in freely. If you use a textbox and custom validation, there'll always be a way around it unless you validate client side as well, but then it still sucks because

    1) It's not intuitive to the user
    2) Duplicating effort

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width