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?
public string CreateDataBase(string ipAddress, string UserName, string Password,string DB_filepath) {