Results 1 to 2 of 2

Thread: Database error What this error means >.<

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2001
    Posts
    41

    Database error What this error means >.<

    An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.data.dll

    Additional information: An OleDbParameter with ParameterName 'LoginName' is not contained by this OleDbParameterCollection.

    Here is the code that created the errors

    'open data connecttion and set up the SQL query
    OleDbConnection1.Open()
    OleDbCommand1.CommandText = "SELECT Users.* FROM Users WHERE (LoginName = ?) AND (LoginPassword = ?)"

    'Press the Value to the SQL query
    OleDbCommand1.Parameters("LoginName").Value = Me.LoginTxt.Text
    OleDbCommand1.Parameters("LoginPassword").Value = Me.PasswordTxt.Text

    i = OleDbCommand1.ExecuteScalar

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    I'm guessing that you did'nt insert LoginName into the parameter collection.

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