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
Daniel Rabinovits
NA
34
7.7k
ExecuteReader: CommandText property has not been initialized
Jan 31 2020 10:15 AM
Trying to execute a stored procedure in Oracle and import the data into a dataset.
I keep getting ExecuteReader: CommandText property has not been initialized error.
I am not using a DataReader. Why is this poping up?
My code is as follows:
var odbcCommand = conn.CreateCommand();
OdbcParameter ODBCParameter1 = new OdbcParameter("@FROMDATE", OdbcType.VarChar, 30);
ODBCParameter1.Value = "01/28/2020";
OdbcParameter ODBCParameter2= new OdbcParameter("@TODATE", OdbcType.VarChar, 30);
ODBCParameter2.Value = "01/29/2020";
OdbcCommand ODBCCommand = new OdbcCommand("getReport", conn);
odbcCommand.CommandType = CommandType.StoredProcedure;
odbcCommand.Parameters.Add(ODBCParameter1);
odbcCommand.Parameters.Add(ODBCParameter2);
OdbcDataAdapter da = new OdbcDataAdapter(odbcCommand);
conn.Open();
DataSet ds = new DataSet();
da.Fill (ds);
Reply
Answers (
1
)
boostrap or html email templated
sending hyperlink to oracle table