I'm getting a headache from this...hope someone can help me.
I have a Table Clienten and made 3 new colums:
- DhrMevr
- Voornaam
- Achternaam
I refreshed the database, deleted the old DataSet and created a new DataSet for the updated database. However...when I try to read the Clienten table in C# code, he doesn't see the new columns. What am I missing?
Hope someone knows the trick.
This is the code....I get the error: Invalid column name "Achternaam"
private void FillCBClienten()
{
string query = "SELECT * from Clienten ORDER BY Achternaam ASC";
using (connection = new SqlConnection(connectionString))
using (SqlDataAdapter adapter = new SqlDataAdapter(query, connection))
{
DataTable clientenTable = new DataTable();
adapter.Fill(clientenTable);
clientenTable.Columns.Add("Naam", typeof(String), "DhrMevr + ' ' + Voornaam + ' ' + Achternaam");
cbClient.DisplayMember = "Naam";
cbClient.ValueMember = "Id";
cbClient.DataSource = clientenTable;
}
}