Unless you can tell us the exact error message, I doubt if you can be helped.
On Feb 22, 8: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
