我添加了一个连接,它显示在其他连接"中,但我似乎无法引用它.
I added a connection and it shows up in "Other Connections" but I can't seem to reference it.
var db = Database.Open("MyNewConnection");
抛出异常:未找到连接字符串MyNewConnection".
您是否检查过 web.config 文件中的连接字符串是否正确?
Have you checked to make sure your connection string is correct in your web.config file?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add
name="MyNewConnection"
connectionString= "server=myServer;database=myDatabase;uid=username;pwd=password"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
这篇关于如何使用 WebMatrix 连接到 SQL Server 数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
我应该使用什么 SQL Server 数据类型来存储字节 What SQL Server Datatype Should I Use To Store A Byte[](我应该使用什么 SQL Server 数据类型来存储字节 [])
解释 SQL Server 中 sys.objects 中的类型代码Interpreting type codes in sys.objects in SQL Server(解释 SQL Server 中 sys.objects 中的类型代码)
Typeorm .loadRelationCountAndMap 返回零Typeorm .loadRelationCountAndMap returns zeros(Typeorm .loadRelationCountAndMap 返回零)
MS SQL:ISDATE() 是否应该返回“1"?什么时候不能MS SQL: Should ISDATE() Return quot;1quot; when Cannot Cast as Date?(MS SQL:ISDATE() 是否应该返回“1?什么时候不能投射为日期?)
将一天的名称转换为其整数表示Converting the name of a day to its integer representation(将一天的名称转换为其整数表示)
如何在 SQL Server 中将 nvarchar m/d/yy 转换为 mm/dd/yHow to convert nvarchar m/d/yy to mm/dd/yyyy in SQL Server?(如何在 SQL Server 中将 nvarchar m/d/yy 转换为 mm/dd/yyyy?)