Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

Anyone knows in what kind of object i can put my deserialized file...?

I've serialized the file with a Class Film and now I want to deserialize it.

       List<Accounttemplate> ac = new List<Accounttemplate>();
       public List<Accounttemplate> FindAcc()
       {            
FileStream fs = new FileStream(@"/Accounts.xml",    FileMode.OpenOrCreate, FileAccess.Read);
           XmlSerializer sr = new XmlSerializer(typeof(Accounttemplate));
       // I want to put this in an object so i can return it and then put the List in a Datagrid view.
sr.Deserialize(fs);
       fs.Close();

Posted

You can try this

 

List<Accounttemplate> listReturn = new List<Accounttemplate>();
listReturn = (List<Accounttemplate>)sr.Deserialize(fs);

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...