This is a migrated thread and some comments may be shown as answers.

[Solved] Binding RadGridview for Winforms Error

2 Answers 63 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
James
Top achievements
Rank 1
James asked on 17 Nov 2010, 11:26 PM
I followed the video and typed the code as displayed:

using

 

 

System;

 

 

 

using System.Collections.Generic;

 

 

 

using System.ComponentModel;

 

 

 

using System.Data;

 

 

 

using System.Drawing;

 

 

 

using System.Linq;

 

 

 

using System.Text;

 

 

 

using System.Windows.Forms;

 

 


namespace 
WindowsFormsApplication1

 

{

 

 

    public partial class Form1 : Form

 

 

    {

 

 

 

        public Form1()

 

        {

            InitializeComponent();

        }

 

 

        private void Form1_Load(object sender, EventArgs e)

 

        {

 

 

            AdventureWorksEntityDiagrams entities = new AdventureWorksEntityDiagrams();

 

            radGridView1.DataSource =entities.Products;

        }

    }

 

}

I get the following error:
The type initializer for 'TelerikBinding.AdventureWorksLTEntityDiagrams' threw an exception.

Any ideas why?

 

 

2 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 22 Nov 2010, 11:30 AM
Hi James,

 It seems that the constructor of your context is throwing an exception. Are you using data services? The exception seems to be caused during invocation of the constructor via reflection.
Any additional information regarding your project will be useful.

Best wishes,
Petar
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
James
Top achievements
Rank 1
answered on 22 Nov 2010, 04:29 PM
I created a new thread with the same name. You can delete this one. Thanks...
Tags
General Discussions
Asked by
James
Top achievements
Rank 1
Answers by
PetarP
Telerik team
James
Top achievements
Rank 1
Share this question
or