开发者

How to store values in database C#?

I have a form that has text boxes, buttons on it for the user to sign up and sign in. I need to store the entered sign up credentials in any开发者_JS百科 database(Oracle, Service based database, local database). Then when he tries to sign in, entered credentials should be compared with stored sign up values for authentication.

This is done in visual studio, c#. Can anyone please give me hints or any references?

Thank you


I would recommend using ASP.NET membership provider, why try to reinvent the wheel.


I agree with what durilai suggested and here is a useful link that might help you get started http://msdn.microsoft.com/en-us/library/tw292whz(v=VS.100).aspx

Using a DB or even AD is to just authenticate is pretty easy and a membership provider does most of the work for you.


use the membership provider in ASP.NET

Go here for examples: http://www.asp.net/Learn/Security/#membership


First, because you are dealing with security, be absolutely certain to use a parameterized stored procedure in lieu of an ad hoc query to help prevent against SQL injection hacking. Stored procedures also perform better than ad hoc queries, overall, traditionally.

After that, are you asking how to use ADO .NET to use a SqlDataReader or OleDbDataReader to return the results, or just what to consider?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜