Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am getting this error System.Data.EvaluateException: 'Cannot find column [Server].'
please help on this issue

What I have tried:

private void cmbServer_SelectedIndexChanged(object sender, EventArgs e)
        {
            //CleanupDataTable(dt);
            LicenseAllctnGridView.DataSource = objDBIO.ImportLicenseUsageDataFromDB(DBPath);
            ((DataTable)LicenseAllctnGridView.DataSource).DefaultView.RowFilter = $"Server Like '{cmbServer.SelectedItem.ToString()}%'";//error in this line

        }
C#
<pre lang="C#"><pre lang="C#"><pre lang="C#">
Posted
Updated 2-Mar-21 7:15am

1 solution

Read the error message, it's pretty clear:
Cannot find column [Server]

Then look at your filter:
...RowFilter = $"Server Like '...
The filter looks at your data source, and can't find any column called "Server" so it - rightly - complains.

I'd start by look at the data returned by the previous line in the debugger while your code is running...

Sorry, but we can't do that for you!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900