TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
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();
Reply
Answers (
2
)
Test your skills:
Passing Parameter Mechanisms