Multipage web app with multi SQL tables.

.Net experts out there, what do you guys do when you're building a multi-page web form and wiring it to a SQL database? Please help. This is my first major project and I am at a loss here. Sorry, I'm a newb. Oh and I have a table for each page. So like the first page is called demographics.aspx and it dumps to a table called Data_Demographics; the second page is called employment.aspx and dumps to a table called Data_Employment. So I'm creating what I call a "Token" like this:
Private Function CreateUserID()    'or could be called CreateToken()
       
        Dim str As New StringBuilder(Left(tbLastName.Text, 3))
        Dim currentDate As Date = Now
        Dim [ReturnValue] As String

        str.Append(currentDate.ToString("MMMddyy"))
        str.Append(Right(mstbSSN.Text, 4))
        str.Append(currentDate.ToString("hhmmssff"))

        [ReturnValue] = str.ToString.ToUpper
        Return [ReturnValue]

End Function
And that's how I would like to keep track of each user in the database if possible. Can anyone out there help me out or have a better suggestion?

Very much appreciated in advance.

RFR
RunForrestRunAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AielloJCommented:
RunForrestRun:

Before you address your coding question, I'm concerned about your statement that there's a table for each web page.  I suspect that your data page layout coincidently happens to match a proper data model.  Your data model (How information relates to other information) is one of the biggest - if not the biggest - critical success factors in ANY database application.  Try Googling "data model concepts" and do some studying, especially the "Rules of Normalization."  Tables are created around "entities" - not the physical design of data input or display pages.

It appears you're trying to identify people by tokens made up of parts of their names, dates, and times.  These schemes usually end up not working as duplicate tokens can get generated, and they end up being a coding nightmare.  Most database tables have an ID which is an automatically generated large sequential number for identifying table rows.

Do some studying of data modeling and rework your design to what you learn from that.
0
AielloJCommented:
RunForrestRun:

REPOST WITH CORRECTIONS

Before you address your coding question, I'm concerned about your statement that there's a table for each web page.  I things the odds are pretty improbable that your data page layout coincidently happens to match a proper data model.  Your data model (How information relates to other information) is one of the biggest - if not the biggest - critical success factors in ANY database application.  Try Googling "data model concepts" and do some studying, especially the "Rules of Normalization."  Tables are created around "entities" - not the physical design of data input or display pages.

It appears you're trying to identify people by tokens made up of parts of their names, dates, and times.  These schemes usually end up not working as duplicate tokens can get generated, and they end up being a coding nightmare.  Most database tables have an ID which is an automatically generated large sequential number for identifying table rows.

Do some studying of data modeling and rework your design to what you learn from that.
0
RunForrestRunAuthor Commented:
Awesome, I am not a database guy. I like the web site www.datamodel.org, it has some really good articles. Thanks a lot AielloJ. I think I need to rethink some things. I'm just going to leave this open for a few more days to see what kind of response I get.

Many, many thanks.

RFR
0
AielloJCommented:
Getting the data model right should always be the first step.  The entities and their relationships to each other is independent of input form layout, programming/scripting languages, etc.  A good data model eliminates almost all, if not all, of the code to move and copy things around, etc, and is the best chance for your project to be a success.

It appears from your description you have at least 3 entities: Demographics, Employment, and Users.  What will probably replace your tokens is the ID column of the Users table.  The ID value is automatically generated for you when you insert the users data into the table, and it's guaranteed to be unique.  That concept eliminates the entire need to generate your own tokens via a function.

Hope to hear back in a few days.

JRA
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RunForrestRunAuthor Commented:
Thanks AielloJ, you have been more than helpful.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.