Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Import Excel Workbook.Load() problem

Win7, Vs2010 , silverlight 4


Hi, When i try to run this code, it trows exception like that "The type initializer for 'SR' threw an exception." on Workbook.Load().

Code from

void Button_Click(object sender, RoutedEventArgs e)
OpenFileDialog openfileDialog = new OpenFileDialog();
Workbook workbook1;

// Open dialog
if (openfileDialog.ShowDialog() == true)
// If user selected a file get the stream of that file
FileStream stream = openfileDialog.File.OpenRead();

// Load workbook with data
workbook1 = Workbook.Load(stream);




No Data
  • 0
    Offline posted

    i am just going to update this page because i almost wasted an half day for this issue and infragistic help forume and support really is not good in helping us so we have to help eachother . 

    Guys ! if you are getting this error you  just need go and install "System.Text.Encoding.CodePages" from Nuget and them put "  Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);" where you are reading the stream . 

    that is ALL !!!!

    this error causes due to problem of reading Encode 1225 and would be solved by this solution only 

No Data