OraDataReader / ASP.Net
Is there any reason why I can't bind an OraDataReader to a DataGrid control like I could with a SqlDataReader? I'm receiving a "Specified method is not supported" error message when trying to do so. Not supported? Why?
Code snippet:
protected System.Web.UI.WebControls.DataGrid paymentMethodGrid;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
OraConnection oraConnection = new OraConnection(ConfigurationSettings.AppSettings.Get("connectionString"));
OraCommand oraCommand = new OraCommand("pkg_css_session_state.prc_payment_method", oraConnection);
oraCommand.CommandType = CommandType.StoredProcedure;
oraCommand.Parameters.Add("my_ref_cursor", OraDbType.RefCursor, DBNull.Value, ParameterDirection.Output);
try
{
oraConnection.Open();
oraCommand.ExecuteNonQuery();
OraRefCursor oraRefCursor = (OraRefCursor) oraCommand.Parameters["my_ref_cursor"].Value;
OraDataReader oraDataReader = oraRefCursor.GetDataReader();
paymentMethodGrid.DataSource = oraDataReader;
paymentMethodGrid.DataBind();
/*
while (oraDataReader.Read())
{
Response.Write(oraDataReader["id"].ToString() + "<br>\n");
}
*/
}
catch (Exception mE)
{
throw mE;
}
finally
{
oraConnection.Close();
}
}