View Single Post
  #9 (permalink)  
Old April 10th, 2010, 02:23 PM
ran_stb ran_stb is offline
Registered User
 
Join Date: Apr 2010
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Thanks for your help, one more small issue,

I'd like to set a query to a GridView control in order this GridView display the query result.
I do the following but I can not see the gridview,
What should I do, please advise.
Thanks,

protected void Page_Load(object sender, EventArgs e)
{
string oradb = "Data Source=LOCAL_XE;User Id=tzdl_user;Password=rans;";
OracleConnection conn = new OracleConnection(oradb); // C#
conn.Open();

OracleParameter parm = new OracleParameter();
parm.OracleDbType = OracleDbType.Decimal;
parm.Value = 777;

OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.Parameters.Add(parm);

cmd.CommandText = "select * from competence_test where id_num = :1";

cmd.CommandType = CommandType.Text;

OracleDataReader OraRecReader = cmd.ExecuteReader();

CompetenceTestGridView1.DataSource = OraRecReader;

conn.Dispose();
}