Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UserNames and Passwords questions

Status
Not open for further replies.

assimang

Programmer
Mar 11, 2008
96
Hello everybody,
I am creating an application which interacts with a dadabase typing.mdf created in Microsoft SQL Server Management Studio Express 2005.
One table of typing.mdf is Users with two fields UserID and PasswordID.
The purpose of Users table is that when the application runs I load a login form. Well, if a user opens the application for the first time, he has to enter a username and a password that will be stored in users table in typing database, then the program checks if username is available which means that there is not stored in users table in typing database, and if it is username and password are storing in database. Else if he is not using the program for the first time, he enters his username and password and the program checks if the user exists in users table and logins. My first question is how many characters should be the username and password and which characters are not allowed for username and password?
And the second question, must I have to set username’s and password’s values to connection string in my code?

Thanks in advanced.
 
That is all totally up to you and your needs later as much as what you need now. If you want a rule of thumb I've always heard 8 and 8. The only thing I would say is don't allow special characters (i.e.. #$%@&*!~` so on and so forth). Not in the connection string, but they would need to be in your query string. Connection string username and passwords are if the database is password protected.

-I hate Microsoft!
-Forever and always forward.
 
Thank you Sorwen, I suppose that if I want the username to be 10 or 15 characters is not a wrong way.
 
Nope. Nothing wrong with it. Some of our usernames are well over 10.

-I hate Microsoft!
-Forever and always forward.
 
Hello

I am planning to develop an application that will be 3-tier (N-Tier} using Visual Basic in Visual Studio 2008 (VS 2008).

By 3 tier I mean:
Tier 1) Handles User Interface/Presentation,
Tier 2) Applies Business Rules/Logic (Validation of data etc) and
Tier 3) Data management (retrieve, store etc).

Previously in VS 2005 I have created 3 tier applications. However, with VS 2005 I have never used data binding of the form fields to the datasource because:
a) I considered it was not flexible enough and
b) I could not easily keep the business logic in Tier 2 separate from the tier 1 presentaion or tier 3 data access.

BUT in VS2008 after viewing the video from Beth Massi on 'How Do I: Use Datasets in an N-Tier Application' refer:


it appeared that Data Binding is much better catered for in VS2008 and that it seemed the best way to go when developing applications as it reduced coding etc and visual designers could be used to improve productivity etc when working with DataSources. Aslo Data binding appears much improved.

In VS2005 I would create the 3 Tiers as separate projects in the one solution (the same as in the video on VS2008]. I would create a refererence from Tier 1 to Tier 2 so I can access the business logic. In tier 2 (Business logic) I created a reference to Tier 3 (the Data Management tier) so that the business logic tier can action a data save or retrieve apply business rules to data before handing it to the tier 1 for presentation. NB: The way I set up my references was different to the video on VS2008 N-Tier.

[Red]OK so this gets me to my problem.[/Red]

In the VS2008 How to video from Beth Massi a reference is set up from Tier 1 to Tier 2. Then when in the Tier 3 (Data management Tier) a datasource can be added via a designer.

VS2008 allows for N-Tier in the designer through a feature called N-Tier Datasets which basically allow you to specify in the Dataset designer a place where the data access code should be generated and where the dataset structure and validation code should be put. This allows you to physically separate these classes and allows you to share only the data validation code on the client whilst leaving the data acess code (the table adaptor code etc) on the server. In the Video the N-Tier solution uses a WCF Service to access the Tier 3 DAL (to retrieve, save data etc). The Tier 3 has a reference to Tier 2 to apply business logic to returned dataset.

[Red]My problem with this is that I don't want to use a 'WCF service' in my application to action data retrieves or saves etc.[/Red] I must admit that I don't really understand WCF services and also are reluctant to introduce another variable in my applications that could cause problems (like service not setup or running etc. I would rather action the Retrieve dataset from the form_load event in the Tier 1 without using the WCF Service.

Because the solution on the video uses the WCF service i.e. the Tier 1 Client/Presentation tier includes a reference to the WCF Service, and also a reference to Tier 2. Tier 3 has a reference to Tier 2. Tier 2 has no reference to Tier 3 (and I can't create one because it would create a circular reference), hence I can't action for example a retrieve of a dataset in the form_load event without using the WCF Service. (NB: Previously I would have written the code in Tier 2 which called a retrive of the data from Tier 3 then applied any busines rules to the data and handed it to Tier 1 for presentation, but using VS2008 designers and data binding I can't do this without using the WCF service).

I would like to use data binding now in VS2008 as it appears to have matured somewhat. Also, I embrace N-Tier in all new applications I design as I have found them to be much more maintainable and logical to develop.

I want to know if anyone else has experience with N-Tier particularly considering the VS2008 improvements?

Does any one have a way of using the VS2008 designers etc and developing without using a WCF Service? or is it not possible to do when using the VS2008 datasource designers?

Any comments or advice or clarification would be appreciated. Also any advice on WCF service would be appreciated.

regards
Kieran777
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top