1

I want to copy the sqlserverCe database(.sdf) tables into another sqlserverCe database(.sdf) in the same application in ASP.NET.

Is it possible? If possible, please help me how can I do this?

2
  • Just schema or schema and data? Commented Jun 8, 2011 at 10:36
  • Hi thank you for giving response i want copy the schema only. Commented Jun 8, 2011 at 10:43

1 Answer 1

1

You could use my scripting library, which can script entire schema to a file, and run the script using the ExecuteSql method against the other sdf file. http://exportsqlce.codeplex.com

Sign up to request clarification or add additional context in comments.

5 Comments

Hi,actually i have create a one template database(template.sdf "it has table of schema only no data") it has the tables,when a user login then create one new database and add the tables from template.sdf to user.sdf database.
Then cant you just copy template.sdf and rename it to user.sdf?
because it is default database for every user not only for one user.
so create COPY for every user. For example for user1 copy template.sdf to user1.sdf...for user2 copy template.sdf to user2.sdf. Code: File.Copy("template.sdf", "user1.sdf") you will have template.sdf and user1.sdf after this.
after copying file how can i store that user.sdf file in serverpath App_data

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.