Rinu,
It seems that you are not setting the data member of the grid to point
to the table to bind to. This needs to be done for the DataGridView. If
you are using a DataGrid view, then I believe just setting the data set
should work.
Try to set the data source to the DataTable in the DataSet you just
filled.
If that doesn't work, then check to see that you are actually getting
results from the stored procedure, as that's always a possibility.
Also, if you are using the DataGridView, then make sure the
AutoGenerateColumns property is set to true, or, if it is false, make sure
you add the columns to be bound to.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Rinu Gopalakrishna Pillai"
<Ri*********************@discussions.microsoft.com wrote in message
news:DE**********************************@microsof t.com...
Hi All,
I have an application that fetch data thru a store proc and display in a
datagrid, but after successful execution of proc the data grid is not
visible.Please go thru the following code and plz let me know what is
missing.The data grid propertiy "Visible is true".
try
{
OracleDataAccess oracleDA = new OracleDataAccess("Data
Source=dsname;User ID=uid;Password=pwd");
if (oracleDA.OpenDBConnection() == false)
{
return;
}
OracleConnection oracleConn = oracleDA.DBConnection;
OracleCommand psCommand = new
OracleCommand("PKG_NAME.STORED_PROC_NAME", oracleConn);
psCommand.CommandType = CommandType.StoredProcedure;
OracleParameter param = new OracleParameter("RESULT_CURSOR",
OracleType.Cursor);
param.Direction = ParameterDirection.Output;
psCommand.Parameters.Add(param);
param = new OracleParameter("IN_DATE", OracleType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = txtBoxBeginDate.Text;
psCommand.Parameters.Add(param);
// Execute command
OracleDataReader reader = psCommand.ExecuteReader();
if (!reader.HasRows)
{
reader.Close();
return;
}
OracleDataAdapter odad = new OracleDataAdapter(psCommand);
DataSet ds = new DataSet();
odad.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
oracleConn.Close();
}
catch (Exception ex)
{
}
Thanks and Regards
Rinu G Pillai