Sudheer Kumar

Sudheer Kumar

  • NA
  • 105
  • 10.4k

getting invalid identifer error when fetching the data from

Aug 27 2015 8:58 AM
OracleConnection conn = new OracleConnection(oradb);
OracleCommand cmd = new OracleCommand();
conn.Open();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.BindByName = true;
//cmd.Parameters.Add(new OracleParameter("BranchID",BranchId));
OracleParameter transdate1= new OracleParameter();
transdate1.OracleDbType = OracleDbType.Date;
transdate1.Value = TextBox1.Text;
cmd.Parameters.Add(transdate1);
OracleParameter transdate2 = new OracleParameter();
transdate2.OracleDbType = OracleDbType.Date;
transdate2.Value = TextBox2.Text;
cmd.Parameters.Add(transdate2);
cmd.CommandText = "select * from cust_details where transdate between transdate1 and transdate2";
OracleDataAdapter od = new OracleDataAdapter(cmd);
DataSet ds = new DataSet();
od.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
//Response.Write("Connected to Oracle" + conn.ServerVersion);
// Close and Dispose OracleConnection object
lblDisplay.Text = "connected";
conn.Close();
conn.Dispose();

Answers (2)