I have a combobox and a datagridview bound to a table in my database.The combobox shows the "ID"s and i want to display a complete row in the gridview based on a selected id in the combobox.
Jump to Post
you need to make sure your combobox is accessable (make it public) and do something like
int id = Convert.ToInt32(combBox.text); string sqlStatement = "SELECT columnName1, columnName2, columnName3 FROM TableName WHERE IDColumn = ' + id + '";
Hope this helps
All 3 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.