thx daveauld I fix iT!?? Thx ALot!?
Saqib Jabbar
Posts
-
Object reference not set to an instance of an object. -
Object reference not set to an instance of an object.Ur ans was CoOl But if fix the Data Adapter Then It will show another exception in da.fill(dt) //Could not find file 'D:\Login\Login\Login\bin\Debug\login.mdb'.
-
Object reference not set to an instance of an object.Public Class form_login Private Sub btn_login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_login.Click Get_Data() End Sub Public Sub Get_Data() Dim qty As String Dim cons As String qty = "SELECT * FROM LOGIN WHERE USER_ID = @USER_ID AND PASSWORD = @PASSWORD" cons = "Provider=Microsoft.Jet.OLEDB.4.0;data source=login.mdb" Dim con As New OleDbConnection() con.ConnectionString = cons Dim com As New OleDbCommand() com.CommandText = qty Dim da As New OleDbDataAdapter() da.SelectCommand.Parameters.AddWithValue("@USER_ID", txt_user_id.Text)--------error occurs on this line---- da.SelectCommand.Parameters.AddWithValue("@PASSWORD", txt_password.Text) Dim dt As New DataTable da.Fill(dt) If dt.Rows.Count > 0 Then Success.user_id = dt.Rows(0)("USER_ID").ToString Me.Hide() Success.Show() End If End Sub End Class Please help me out of thhis