Alexthemaster Posted December 16, 2008 Posted December 16, 2008 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(); Quote
Nate Bross Posted December 17, 2008 Posted December 17, 2008 You can try this List<Accounttemplate> listReturn = new List<Accounttemplate>(); listReturn = (List<Accounttemplate>)sr.Deserialize(fs); Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
Alexthemaster Posted December 17, 2008 Author Posted December 17, 2008 Thank's a lot, it works:) , i had tryed to cast it into a couple of other things before but couldn't find one that worked. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.