2

I have a SQL Server database, i need to export all of the data into an Access mdb that users can download. What's the simplest way of doing this from C#?

I realise I could have a blank (but with schema in place) mdb, and when i want to export I could copy it, then read all the data from SQL Server into the mdb via datasets, but that seems like a right faff. Is there an easier way?

Thanks

4
  • 1
    Why not just use the 'Import/Export' feature in SQL Management Studio to create the Access database when needed? Much easier than writing your own code. Commented Nov 1, 2010 at 16:48
  • because the user needs to action it, although i may suggest this as an option Commented Nov 1, 2010 at 16:57
  • is there a way to automate/expose that feature somehow so it doesnt need to be a manual task? Commented Nov 1, 2010 at 17:00
  • It is possible to create an mdb or accdb with ADOX, if that is any help: support.microsoft.com/kb/317881 Commented Nov 1, 2010 at 22:33

1 Answer 1

2

Could you create a DTS Package to do the export, then write a C# app to execute the DTS package, the user then just needs to execute your C# app? You could also set the DTS package to run automatically if you don't want user interaction.

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

Comments

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.