D
dshiel
Hi there,
I am trying to first retrieve a stored proc Return Value to determine
what happened in the proc, and then if the value = 0 (Success in my
case) I want to iterate through the resultset to show my data to the
user.
Is this possible??
I'm using OleDB in ASP.NET. Win2000, .NET 1.1.
Heres my code so far:
// Connect to me database
m_DB = new OleDbConnection(CConfigInfo.DBConnectionString);
m_DB.Open();
// Run my stored proc
OleDbCommand m_dbCmd
m_dbCmd = new OleDbCommand({ ? = CALL sp_GUI_PedsGET }, m_DB);
m_dbCmd.CommandType = CommandType.Text;
OleDbParameter cParam = m_dbCmd.Parameters.Add("@RETURN_VALUE",
OleDbType.Integer);
cParam.Direction = ParameterDirection.ReturnValue;
OleDbDataReader cDataReader = m_dbCmd.ExecuteReader();
cDataReader.Close();
// at the moment I have to close the DataReader to read the return
value, but I dont know how to reopen it so I can iterate through
// the resultset. If I dont close the DataREader I can iterate through
the resultset but cant read the return value. Arrrggghhhhh!
switch ((int)(cParam.Value))
{
case 0:
ProcessResultset(cDataReader);
break;
....
}
I have done this without any problems in C++ so it must be possible.
Thanx in advance,
Dave.
I am trying to first retrieve a stored proc Return Value to determine
what happened in the proc, and then if the value = 0 (Success in my
case) I want to iterate through the resultset to show my data to the
user.
Is this possible??
I'm using OleDB in ASP.NET. Win2000, .NET 1.1.
Heres my code so far:
// Connect to me database
m_DB = new OleDbConnection(CConfigInfo.DBConnectionString);
m_DB.Open();
// Run my stored proc
OleDbCommand m_dbCmd
m_dbCmd = new OleDbCommand({ ? = CALL sp_GUI_PedsGET }, m_DB);
m_dbCmd.CommandType = CommandType.Text;
OleDbParameter cParam = m_dbCmd.Parameters.Add("@RETURN_VALUE",
OleDbType.Integer);
cParam.Direction = ParameterDirection.ReturnValue;
OleDbDataReader cDataReader = m_dbCmd.ExecuteReader();
cDataReader.Close();
// at the moment I have to close the DataReader to read the return
value, but I dont know how to reopen it so I can iterate through
// the resultset. If I dont close the DataREader I can iterate through
the resultset but cant read the return value. Arrrggghhhhh!
switch ((int)(cParam.Value))
{
case 0:
ProcessResultset(cDataReader);
break;
....
}
I have done this without any problems in C++ so it must be possible.
Thanx in advance,
Dave.