On Sun, Feb 22, 2009 at 5:51 AM, zamae <[email protected]> wrote:

>
> How can i do??
>
> the problem is when I try to run program
>
> it will show the dr = .ExecuteReader error
>
> this is for Login button....
>
> 'create Query
>        sb = New StringBuilder
>        sb.Append("Select * From USER")
>        sb.Append(" Where (USER_ID = @ID)")
>        sb.Append(" And (USER_PASS = @Password)")
>
>        TEMP = sb.ToString
>
>        Com = New SqlCommand
>        With Com
>            .CommandText = TEMP
>            .Connection = Conn
>            .Parameters.Clear()
>            .Parameters.Add("@ID", SqlDbType.NVarChar).Value =
> txtUser.Text
>            .Parameters.Add("@Password", SqlDbType.NChar).Value =
> txtPass.Text
>            dr = .ExecuteReader
>        End With
>        If dr.HasRows Then
>            Dim dtUser As New DataTable
>            dtUser.Load(dr)
>
>
>            indexHR.Show()
>            Me.Hide()
>        Else
>            'if it doesn't match from db
>            MessageBox.Show("?????? UserName ???? Password
> ??????????", "HR Program", MessageBoxButtons.OK,
> MessageBoxIcon.Exclamation)
>            txtUser.Focus()
>            txtUser.SelectAll()
>        End If
>        dr.Close()
>        txtPass.Clear()  'Clear Password insides txtPass
>
this a method , so where is the parantheses, it should be written like

dr=.ExcuteReader()

Reply via email to