System.ArgumentException:不支持关键字:' initialcatalog'。 在System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable,String connectionString,Boolean buildChain,Hashtable 同义词,布尔值firstKey)at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable的同义词,Boolean useOdbcRules)at System.Data.SqlClient.SqlConnectionString..ctor(字符串 connectionString)at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(字符串 connectionString,DbConnectionOptions上一页)at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key,DbConnectionPoolGroupOptions poolOptions,DbConnectionOptions& userConnectionOptions)at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey 关键)at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) at WebApplication59.WebForm1.Button1_Click(Object sender,EventArgs e) 在c:\ Users \ rishabhgupta \ Documents \ Visual Studio中 2012 \项目\ WebApplication59 \ WebApplication59 \ WebForm1.aspx.cs中:行 50
答案 0 :(得分:2)
initialcatalog
应该是两个字:Initial Catalog
。