<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Access Databases and AccessDataSource Control</title><link>http://forums.asp.net/55.aspx</link><description>Discuss using Access as a data store for ASP.NET, and the AccessDataSource control.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Serialize an object to insert into a Access table</title><link>http://forums.asp.net/thread/3267604.aspx</link><pubDate>Tue, 30 Jun 2009 23:10:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3267604</guid><dc:creator>SGWellens</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3267604.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3267604</wfw:commentRss><description>&lt;p&gt;You could try serializing it to an&amp;nbsp;XML string using these functions:&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;    /// ---- SerializeAnObject -----------------------------
    /// &amp;lt;summary&amp;gt;
    /// Serialize an object
    /// &amp;lt;/summary&amp;gt;
    /// &amp;lt;param name=&amp;quot;AnObject&amp;quot;&amp;gt;The Object to serialize&amp;lt;/param&amp;gt;
    /// &amp;lt;returns&amp;gt;XML&amp;lt;/returns&amp;gt;
    
    public static string SerializeAnObject(object AnObject)
    {
        XmlDocument XmlDoc = new XmlDocument();
        XmlSerializer Xml_Serializer = new XmlSerializer(AnObject.GetType()); 
        MemoryStream MemStream = new MemoryStream();
        try
        { 
            Xml_Serializer.Serialize(MemStream, AnObject); 
            MemStream.Position = 0; 
            XmlDoc.Load(MemStream); 
            return XmlDoc.InnerXml; 
        }      
        finally 
        { 
            MemStream.Close(); 
        }
    }

    /// ---- DeSerializeAnObject ------------------------------
    /// &amp;lt;summary&amp;gt;
    /// DeSerialize an object
    /// &amp;lt;/summary&amp;gt;
    /// &amp;lt;param name=&amp;quot;XmlOfAnObject&amp;quot;&amp;gt; The XML&amp;lt;/param&amp;gt;
    /// &amp;lt;param name=&amp;quot;ObjectType&amp;quot;&amp;gt;The type of object&amp;lt;/param&amp;gt;
    /// &amp;lt;returns&amp;gt;The deserialized object...must be cast to correct type&amp;lt;/returns&amp;gt;
    
    public static Object DeSerializeAnObject(string XmlOfAnObject, Type ObjectType)
    {       
        StringReader StrReader = new StringReader(XmlOfAnObject);
        XmlSerializer Xml_Serializer = new XmlSerializer(ObjectType);
        XmlTextReader XmlReader = new XmlTextReader(StrReader);
        try
        {
            Object AnObject = Xml_Serializer.Deserialize(XmlReader);
            return AnObject;
        }
        finally
        {
            XmlReader.Close();
            StrReader.Close();
        }
    }
&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Serialize an object to insert into a Access table</title><link>http://forums.asp.net/thread/3267329.aspx</link><pubDate>Tue, 30 Jun 2009 19:21:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3267329</guid><dc:creator>FCP_88</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3267329.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=55&amp;PostID=3267329</wfw:commentRss><description>&lt;p&gt;Hi.&lt;/p&gt;&lt;p&gt;I have an application connected to an access database. I am using a Table Adapter to insert/get data from the table.&lt;/p&gt;&lt;p&gt;I have an object that represents a specific table from the db&amp;nbsp; with more that 50 fields that i need to insert in the database.&lt;/p&gt;&lt;p&gt;How can i serialize&amp;nbsp; that object into something like this (attrib1,atrib2 ...) so i can use the insert method of table adapter?&lt;/p&gt;&lt;p&gt;I can get all the attributes of the object one by one but that would be very time consuming.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>