Dcorso
6/25/2002 6:33:00 PM
I am passing a single parameter to a stored procedure that returns two or
more tables. The first table is created in the dataset with no problem but
I get a NullReferenceException error. Here is the code.
Dim oConn As New OdbcConnection()
Dim oCom As New OdbcCommand()
Dim da As New OdbcDataAdapter()
Dim ds As New DataSet()
oConn.ConnectionString = "DSN=" & ServerName & ";UID=user;PWD=pwd;"
oConn.Open()
oCom.Connection = oConn
oConn.ChangeDatabase(db.Name)
oCom.CommandType = CommandType.StoredProcedure
oCom.Parameters.Add("@parameter", OdbcType.Char, 10)
oCom.Parameters("@parameter").Value = "test"
oCom.CommandText = "{call test_p (?)}"
da.SelectCommand = oCom
da.Fill(ds)