Connection string - Keyword not supported: 'initial catalog'

后端 未结 6 1682
北荒
北荒 2020-12-03 10:47

I am using Webmatrix.data\'s Database entity to create a database connection, however it doesnt like my connection string. I am running it from MVC ASP.net.

Ive tri

6条回答
  •  误落风尘
    2020-12-03 11:25

    check here: Database.OpenConnectionString Method (String, String)

    try to specify the provider name as second parameter, from the MSDN example:

    var connectionString = "Data Source=.\\SQLExpress;Initial Catalog=SmallBakery;Integrated Security=True";
    
    var providerName = "System.Data.SqlClient";
    
    var db = Database.OpenConnectionString(connectionString, providerName);
    

提交回复
热议问题