I'm trying to create a catalog object using a memory stream and then add some datatables to it. My end goal is being able to output a .mdb file that one can open in Access to view the table structure. Am I going about this the wrong way? I want to avoid having the open up a connection, etc when creating this catalog object.

        using (MemoryStream stream = new MemoryStream())
        {
            Catalog catalog = new Catalog(stream);

            foreach (DataTable dt in ds.Tables)
            {
                catalog.Tables.Append(dt);
            }

            return stream.ToArray();
        }

Related posts

Recent Viewed