Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have a winform connected to .accdb file. But while creating rdlc report i found that the naming was not correct in my accdb file(contained hyphen) and i changed it accordingly and configured the data set query too and refreshed the connection , but still during execution the below error is coming .
System.ArgumentException: 'Cannot bind to the property or column Condition_of_DIE-7 on the DataSource.Parameter name: dataMember'

And this is my master table SQL :
SQL
 SELECT        ID, Size_in_mg, Die_head_number, Inspection_Date, Next_Calibration_On, Die_size_in_microns, Condition_of_DIE_1, Condition_of_DIE_2, Condition_of_DIE_3, Condition_of_DIE_4, Condition_of_DIE_5, Condition_of_DIE_6,Condition_of_DIE_7, Observations, Inspector, Issued_to_Maintanance
FROM            MSdies

form load code
C#
private void FormMsdies_Load(object sender, EventArgs e)
       {
           // TODO: This line of code loads data into the 'trialDataSet1.MSdies' table. You can move, or remove it, as needed.
           this.mSdiesTableAdapter.Fill(this.trialDataSet.MSdies);
           // TODO: This line of code loads data into the 'trialDataSet.MSdies' table. You can move, or remove it, as needed.
           this.mSdiesTableAdapter.Fill(this.trialDataSet.MSdies);}


What I have tried:

And this is where the error is showing is my program.cs file
<pre lang="c#">        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FormMsdies());
        }
    }
}
Posted
Comments
Richard MacCutchan 29-Jul-20 10:02am    
You are using Condition_of_DIE_7 (all underscores) in your database, but Condition_of_DIE-7 (hyphen before the 7) in your binding data.
[no name] 29-Jul-20 13:49pm    
Good one!
Member 14898617 29-Jul-20 22:34pm    
Yeah ,how to correct this guide me please?
Richard MacCutchan 30-Jul-20 4:55am    
Seriously? You have two variable names that are different, and you are trying to use them to refer to the same item.
Member 14898617 30-Jul-20 5:10am    
Sir ..I knew what the error was but the problem was even after updating my database & dataset this was showing and yesterday i didn't knew i have to manually correct them in program.cs file which is auto-generated .Now this is solved .Please know that not everyone is as intelligent and smart as you ..there are guys like us who are slow learners.

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