I am trying to create a database programmatically in C#. I have scripts for database creation which work fine when I run them from SQL Server Management Studio. However, when I run the same scripts from my C# application, the following error occurs:
An unhandled exception of type 'Microsoft.SqlServer.Management.Common.ExecutionFailureException' occurred in Microsoft.SqlServer.ConnectionInfo.dll
Any ideas as to why this might be happening?
Just to let you know there is a c# frame work which will do all this for you. http://www.sharparchitecture.net/ it will build your DB and your data access layer from a OO model.