Denaes Posted April 29, 2004 Posted April 29, 2004 I remember writing like 1000 lines of code to create an Access database in vb6. It sucked. I've also seen a method of the dataset is WriteXML, which writes the entire dataset structure to XML. Is there a way to write to Access or another Database? Not even for the data so much as the datastructure. I think that would be swell for errors when a database goes "poof". You can at least start over again. Quote
Moderators Robby Posted April 29, 2004 Moderators Posted April 29, 2004 To Sql Server? If so, you can Import from Access to Sql Server with a few clicks. Quote Visit...Bassic Software
Denaes Posted April 29, 2004 Author Posted April 29, 2004 From DataSet Could have origionated from nothing (you just made it up on the fly), Access, XML or SQL Server. I'm assuming that you have relations and tablenames, columnnames, properties filled out. To: Anything I know XML is possible. Access, Oracle, SQL Server Done in .Net via programming, not an external application (like MS Access, Oracle, SQL Server, etc) Quote
*Experts* Nerseus Posted April 30, 2004 *Experts* Posted April 30, 2004 I don't think there's anything in the standard .NET libraries for creating tables, regardless of the "source". For most databases you can execute a "CREATE TABLE ..." statement to create a table. I don't think there's anything available to do this for you. I'm SURE there are tools that do this for you - create a database from a Dataset. If you want to write it yourself and you know that your DataSets are "clean" then it wouldn't be too hard. You can easily loop through tables, relationships, and columns in a dataset and create these "CREATE TABLE..." statements yourself. By "clean" I'm referring to the fact that a DataSet may have different datatypes than your Database so you'll have to make some assumptions (fine for you, maybe not Ok if this is a more general purpose chunk of code). If your purpose is to rebuild a database, I'd wonder why you wouldn't have a backup? Seems much easier to backup an Access database (one file) or a SQL Server (2 files generally) then to backup a DataSet and have to restore from the DataSet. Plus, a "real" backup would save Queries/Stored Procedures and other niceties. -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
pelikan Posted May 28, 2004 Posted May 28, 2004 often a SQL script used to create a database is saved. You just rerun the script to recreate the database. Quote IN PARVUM MULTUM
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.