5
Answers

Can somebody point out the errors in coding....

Photo of Rao Varrey

Rao Varrey

7y
171
1
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 

Answers (5)

0
Photo of Learn Avid
NA 101 4.8k 7y
Hello Nilesh Patil, thanks for your response. I was trying to build this application using same refrence. But Mukesh Kumar used 'Dotnet.Highcharts' dll and bind graph at server end. I'm trying to do same using jQuery AJAX call.
0
Photo of Nilesh Patil
NA 3.4k 7k 7y
Hi,
 
Refer this and compare your code
 
http://www.c-sharpcorner.com/article/dotnet-highcharts-with-asp-net-mvc/