How does one code a log-in w/ ASP.NET with user/pass's in a SQL server 2005 DB? - persist asp upload torrent
\\ \\ \\ \\ \\ \\ \\ \\ U0026lt; script runat = "server">
Protected Sub Button1_Click (ByVal sender As Object, ByVal e As System.EventArgs)
As SqlConnection conn
SO cmd As SqlCommand
CmdString As String = "SELECT [Password] FROM [Login] WHERE" & "(([Username] = @ username) and ([key] = @ password))"
(conn = new SqlConnection "db.address.com, first" and "Catalog = hillc t = logins; Persist Security Info = True; User ID = re4283; sublime99 Password =")
cmdString cmd = new SqlCommand (CAP)
User cmd.Parameters.Add ( "@", SqlDbType.Char, 50). Value = TextBox1.Text 'if it is not only Char VarChar?
Password cmd.Parameters.Add ( "@", SqlDbType.Char, 50). Value = TextBox2.Text '50 = number of characters allowed?
conn.Open ()
As SqlDataReader myReader
MyReader = cmd.ExecuteReader (CommandBehavior.CloseC ...
If reader.Read () Then
FormsAuthentication
etc. etc.
2 comments:
I believe firmly in place, I recommend to the access control and other best practices, such as a membership provider instead of writing the raw code that way.
If this is not a lesson in the school (and if it \\ \\ \\ \\ \\ \\ \\ \\ u0026lt; want to really 'teach the teachers to speak what is!) What do you learn how to design code correctly.
Try this for a tutorial on how to write a module for connection
http://quickstarts.asp.net/QuickStartv20 ...
But you can also apply, conditions, and quick-start code, all this for you automatically, with no minimum cut.
I believe firmly in place, I recommend to the access control and other best practices, such as a membership provider instead of writing the raw code that way.
If this is not a lesson in the school (and if it \\ \\ \\ \\ \\ \\ \\ \\ u0026lt; want to really 'teach the teachers to speak what is!) What do you learn how to design code correctly.
Try this for a tutorial on how to write a module for connection
http://quickstarts.asp.net/QuickStartv20 ...
But you can also apply, conditions, and quick-start code, all this for you automatically, with no minimum cut.
Post a Comment