|
-
Jan 9th, 2010, 11:38 AM
#1
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
-
Jan 9th, 2010, 03:06 PM
#2
Thread Starter
Member
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?
-
Jan 13th, 2010, 05:24 AM
#3
Re: Calling a Sub in a Different aspx.vb File
 Originally Posted by jwesleycooper
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|