We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error - An item with the same key has already added

Thread ID:

Created:

Updated:

Platform:

Replies:

114927 Dec 13,2013 09:37 PM UTC Dec 23,2013 11:44 AM UTC Windows Forms 6
loading
Tags: DocIO
M.Stephen
Asked On December 13, 2013 09:37 PM UTC

I am having an Error - "An item with the same key has already added" 

using  Syncfusion.DocIO.DLS 

My code is

WordDocument doc = new WordDocument();
 string[] files= new String[]{"file1.doc","fill2.doc"};
foreach (string file in files)
        {
                byte[] fileContent = File.ReadAllBytes(file);
                 MemoryStream ms = new MemoryStream(FileData);
            WordDocument mergeContent = new WordDocument(ms);
            doc.ImportContent(mergeContent);
        }
 MemoryStream returnStream = new MemoryStream();
        doc.Save(returnStream, FormatType.Docx);   // THIS LINE SHOWS THAT ERROR


And it is Console Application

Thanks

M.Stephen
Replied On December 13, 2013 09:42 PM UTC

Sorry one mistake in my code

Replace this 

    MemoryStream ms = new MemoryStream(FileData);

By
     MemoryStream ms = new MemoryStream(fileContent);

Thanks

Sathish K [Syncfusion]
Replied On December 16, 2013 07:12 AM UTC

Hi Stephen,

 

Thank you for your interest in Syncfusion products,

 

We are unable to reproduce the mentioned issue with the code snippet given by you. We have prepared a sample to illustrate the same which just uses your code snippet only. Please find the attached sample and modify the sample to reproduce the issue at our side. Also provide us the details about current Essential studio version which you are using.

 

Please let us know if you have any concerns.

 

Regards,

Sathish



GenerateWord_Windows_50c8d4d1.zip

M.Stephen
Replied On December 16, 2013 01:44 PM UTC

Hello Sathis,

    Thanks for reply.But it not working. Please try it with my attachment file.


Data_13d7e054.zip

Sathish K [Syncfusion]
Replied On December 18, 2013 02:21 PM UTC

Hi Stephen,

Thank you for your update,

We are unable to reproduce the mentioned issue with your attachment files. We have used these attachment files in the previous sample we have updated to you. We have attached the video illustration for the same. Please provide us the sample project you have used to reproduce the issue at our side. Thereby we can analyze further and provide you the appropriate solution.

Please let us know if you have any questions.

Regards,

Sathish



video_a7b74b7f.zip

M.Stephen
Replied On December 20, 2013 03:33 PM UTC

Hello Sathish
Is it working in VS2010?

Sathish K [Syncfusion]
Replied On December 23, 2013 11:44 AM UTC

Hi Stephen,

 

Thank you for your update.

 

The updated sample is working fine with all of the Visual studio versions. If you provide us your sample to reproduce the issue at our end it will be helpful to us to find out the exact root cause of the issue, thereby we will provide you the appropriate solution.

 

Please let us know if you have any other questions.

 

Regards,

Sathish

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;