winnie Posted November 27, 2002 Posted November 27, 2002 hi. i am new to .net programming. i have a simple question here. how can i validate a login form using vb.net and sql? can i get sample code from somewhere? Quote
*Gurus* divil Posted November 27, 2002 *Gurus* Posted November 27, 2002 You'll have to be a little less vague first. It depends on what database you're using, table and field names etc. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
winnie Posted November 29, 2002 Author Posted November 29, 2002 i am using microsoft sql server. there are a few columns such as userid,password,email,DOB and etc. i thought i just have to check for userid and password. if it match, the user can login. is this the right way? Quote
*Gurus* divil Posted November 29, 2002 *Gurus* Posted November 29, 2002 Yes, that's the right way. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
winnie Posted December 3, 2002 Author Posted December 3, 2002 can someone show me how to write this in vb.net code?? i cant seem to get mine to work... Quote
liquidspaces Posted December 3, 2002 Posted December 3, 2002 This is one thing that I know how to do in this kookie language:) Can you show us what you have right now? Quote
winnie Posted December 12, 2002 Author Posted December 12, 2002 my code is very messy right now. can anyone show me how to do it in a proper way?? Quote
a_jam_sandwich Posted December 12, 2002 Posted December 12, 2002 Imports System.Data.SqlClient Module Module9 public Function CheckPassword(ByRef UID As String, ByRef Password As String) As Boolean Dim myConnection As New SqlConnection() Dim myRs As ADODB.Recordset myConnection.ConnectionString = "Data Source=localhost;Integrated Security=SSPI;Initial Catalog=DATABASENAME" myConnection.Open() myRs = New ADODB.Recordset() myRs.Open("SELECT UserID,PASSWORD FROM MyTABLE WHERE UserID='" & UID & "' AND PASSWORD='" & Password & "'", myConnection, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic) If myRs.RecordCount > 0 Then CheckPassword = True Else CheckPassword = False End If myRs.Close() myConnection.Close() End Function End Module Try somthing like this Quote Code today gone tomorrow!
winnie Posted December 30, 2002 Author Posted December 30, 2002 i have tried the code, but still cannot run. is "adodb.recordset" for vb6 only?? Quote
*Gurus* divil Posted December 30, 2002 *Gurus* Posted December 30, 2002 Make sure you have a project reference to Microsoft ActiveX Data Objects. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.