Problem with calling a procedure

mike55

Well-known member
Joined
Mar 26, 2004
Messages
726
Location
Ireland
Can anyone spot the problem with this code:
Code:
clsConnection.OpenConnection(cnConn)

                quickAddAdapter.SelectCommand = New SqlCommand
                quickAddAdapter.SelectCommand.Connection = cnConn
                quickAddAdapter.SelectCommand.CommandText = "QuickSelectMembers"
                quickAddAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
                quickAddAdapter.SelectCommand.Parameters.Add(New SqlParameter("@Organisation", SqlDbType.NVarChar, 10))
                quickAddAdapter.SelectCommand.Parameters("@Organisation").Direction = ParameterDirection.Input
                quickAddAdapter.SelectCommand.Parameters("@Organisation").Value = organisation

                quickAddAdapter.Fill(dsReturn, "Everybody")

The procedure works correctly, I have manually ran it and it returns all the expected data. The error message that I am getting is:
"Value cannot be null. Parameter name: dataSet"

Mike55.
 
Back
Top