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
Israel
701
1.3k
217.2k
Load the second combobox
Nov 24 2014 4:37 AM
Hi!
I have a combobox with three items:
Toyota
Kia
Hyndai
Then I have a small table with two columns (Marks and Models):
Marks | Modelos
Toyota: Camry
Toyota: Celica
Toyota: Corolla
Kia: Optima
Kia: Picanto
Kia: Sportage
Hyundai: Accent
Hyundai: Azera
Hyundai: Elantra
When I select one mark. What happening? I found in the combobox model the table's name repeted in that combobox:
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\rentacar\rentacar\\app_data\rentacar.mdb;Persist Security Info=False";
OleDbConnection sqlCon = new OleDbConnection(connectionString);
sqlCon.Open();
string commandString = "select * from carsconfig where cars ='" + cbxMarkConfig.Text + "'";
OleDbCommand sqlCmd = new OleDbCommand(commandString, sqlCon);
OleDbDataReader read = sqlCmd.ExecuteReader();
if (read.HasRows)
{
while (read.Read())
{
cbxModelsConfig.Items.Add("models"); // it will show the code
}
}
else
{
MessageBox.Show("A record with a code of " + cbxMarkConfig.Text + " was not found");
}
}
}
Reply
Answers (
3
)
Need 1.5 years of experience dot net interview questions?
Xamarin Cross platform.