Results 1 to 4 of 4

Thread: login from password error message

Threaded View

  1. #1

    Thread Starter
    Fanatic Member d2005's Avatar
    Join Date
    Aug 2005
    Location
    ireland
    Posts
    620

    login from password error message

    this code in

    Code:
     Dim conn As New SqlClient.SqlConnection("select * from tb_comp_login", conn)
            Dim SQL As String
    
            SQL = "SELECT comp_password "
            SQL &= "FROM tb_comp_login "
            SQL &= "WHERE comp_username = @comp_username "
    
            Dim Comm As New SqlClient.SqlCommand(SQL, conn)
            Dim Param As New SqlClient.SqlParameter("@comp_username", SqlDbType.VarChar)
            Param.Direction = ParameterDirection.Input
            Param.Value = Username
    
            Comm.Parameters.Add(Param)
    
            Dim da As New SqlClient.SqlDataAdapter(Comm)
            Dim dt As New DataTable
    
            da.Fill(dt)
    
            conn.Close()
            conn.Dispose()
    
            Dim Validated As Boolean
    
            If dt.Rows.Count > 0 Then
                Validated = (dt.Rows.Item(0).Item("Password").ToString = Username)
            End If
    
            Return Validated
    FORMAT OF THE INITIALIZATION STRING DOES NOT CONFORM TO SPECIFICATION STARTING AT 0

    the problem line seems to be dim conn as new sqlclient.sqlconnection("select..

    where should i set up my connection to the databse as this connects to the table
    Last edited by d2005; Sep 4th, 2005 at 09:47 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width