How I can programmable create databases, import database images, get information about existing databases via C#. I am working with SQL Server 2005.
Can you refare me to some tutorial or give me some examples.
Thanks for help.
How I can programmable create databases, import database images, get information about existing databases via C#. I am working with SQL Server 2005.
Can you refare me to some tutorial or give me some examples.
Thanks for help.
you can use SQL Server Management Object (SMO)
http://msdn.microsoft.com/en-us/library/ms162169.aspx
At the end of the day WITH SQL (though it can be encapsuled by object libraries).
Use the management studio and every action you do there can pretty much show the SQL generated. Read trhe documentation. At the end, connect ot a SQL Server and issue statements. You know, stuff like CREATE DATABASE etc. All documented.