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
Gustavo
NA
1.3k
453.9k
ERROR ExecuteReader not initialized
Mar 15 2010 9:23 PM
Hello:
I am trying to read a record and getting an error:
{"ExecuteReader: Connection property has not been initialized."}.
Can someone help?
I have used the same connection inn other places and it does connect. I have the select statement displayed and it looks correct.
DBSQLSelect =
"SELECT "
+
" [SEQNO]"
+
" ,[Name]"
+
" ,[Address_1]"
+
" ,[Address_2]"
+
" FROM"
+
" ["
+ Program_ID +
"]"
+
" WHERE"
+
" [Company_ID] = '"
+ textBoxCompany_ID.Text +
"'"
;
//
string
DBConnection =
@"Server="
+
Program
.ProgramDBServer +
";"
+
"Database="
+
Program
.ProgramDBDatabase +
";"
+
"User ID="
+
Program
.ProgramDBLogin_ID +
";"
+
"Password="
+
Program
.ProgramDBPassword +
";"
;
//
MessageBox
.Show(
"DBConnection="
+ DBConnection);
MessageBox
.Show(
"DBSQLSelect="
+ DBSQLSelect);
//
SqlDataReader
ReadRecord =
null
;
//
SqlConnection
SQLConnect =
new
SqlConnection
(DBConnection);
//
SqlCommand
SQLCommand =
new
SqlCommand
(DBSQLSelect);
//
SQLConnect.Open();
SQLConnect.GetSchema();
//
ReadRecord = SQLCommand.ExecuteReader();
//<<< {"ExecuteReader: Connection property has not been initialized."}
//
textBoxName.Text = (
string
) ReadRecord[
"Name"
];
textBoxName.Text = ReadRecord.GetString(ReadRecord.GetOrdinal(
"Name"
));
Reply
Answers (
3
)
Need to download an xml from a folder on a network and store it in my local.This xml would be contai...
my DataGrid DOESNT display the data?