I am trying to create a content db from asp.net application c# hosted in share point server.
my code is
SPWebApplication elevatedWebApp = spWeb.Site.WebApplication;
string serverName = "xxx\xxx";
string newDbName = "WSS_Content_1";
string username = "xxxx\\spfarm";
string password = "xxxxx";
var contentDatabase = elevatedWebApp.ContentDatabases.Add(serverName,newDbName,username,password,0,1,0);
contentDatabase.Update();
elevatedWebApp.Update();
I got this error message
Cannot connect to database master at SQL server The database might not exist, or the current user does not have permission to connect to it.
I'd appreciate any thoughts.
Thanks