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
Rao Varrey
NA
56
3.1k
Can somebody point out the errors in coding....
Oct 16 2017 12:50 AM
OdbcConnection myConnection = new OdbcConnection();
OdbcCommand cmdCombo = myConnection.CreateCommand();
OdbcCommand cmdList = myConnection.CreateCommand();
string myConnectionString = @"Driver={Microsoft Access Driver (*.mdb)};" + "Dbq=C:/DROPS-Data/Derrick.mdb";
{
myConnection.ConnectionString = myConnectionString;
myConnection.Open();
//execute queries, etc
cmdCombo.CommandText = "SELECT * FROM DerrickAreas";
OdbcDataReader readerCombo = cmdCombo.ExecuteReader();
if (readerCombo.HasRows)
{
while (readerCombo.HasRows)
{
comboBox1.Items.Add(readerCombo["Section"].ToString());
readerCombo.NextResult();
}
}
else
{
MessageBox.Show("No records");
}
myConnection.Close();
I am trying to populate the comboBox with data from Access database, which has 8 records, but it is showing only the first record
Can somebody point out the errors in this code
Reply
Answers (
5
)
CRUD Operation in MVC4 for image Upload.
How to convert numbers into text in Devexpress Report ?