Link to home
Start Free TrialLog in
Avatar of ayha1999
ayha1999

asked on

BindingSource error

hi,

I get a compilation error in the follwoing code.

errors:
Error      1      An object reference is required for the non-static field, method, or property 'System.Windows.Forms.BindingSource.DataMember.get'

Error      2      An object reference is required for the non-static field, method, or property 'System.Windows.Forms.BindingSource.DataSource.get'

code:
 private void Form1_Load(object sender, EventArgs e)
        {
            DBO db = new DBO();
            BindingSource.DataMember = "Sample";
            BindingSource.DataSource = db;
            this.reportViewer1.RefreshReport();

        }

How can I solve the problem?

Please help

ayha
ASKER CERTIFIED SOLUTION
Avatar of Paul Jackson
Paul Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ayha1999
ayha1999

ASKER

Thanks