Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Database 我需要做些什么吗;特别";要在Visual Studio中使用WebMatrix数据库帮助程序';12?_Database_Razor_Visual Studio 2012_Webmatrix 2 - Fatal编程技术网

Database 我需要做些什么吗;特别";要在Visual Studio中使用WebMatrix数据库帮助程序';12?

Database 我需要做些什么吗;特别";要在Visual Studio中使用WebMatrix数据库帮助程序';12?,database,razor,visual-studio-2012,webmatrix-2,Database,Razor,Visual Studio 2012,Webmatrix 2,我正在WebMatrix中进行一些基本的数据库查询 大概 @{ var db = Database.Open("test"); //test is the name of my database var selectQuery = "SELECT * FROM MY_CUSTOM_TABLE" } //Doing a `@foreach` and showing the items from the table 当我在Visual Studio中做同样的事情时 我在var db=Da

我正在WebMatrix中进行一些基本的数据库查询

大概

@{
  var db = Database.Open("test"); //test is the name of my database
  var selectQuery = "SELECT * FROM MY_CUSTOM_TABLE"
}

//Doing a `@foreach` and showing the items from the table
当我在Visual Studio中做同样的事情时

我在
var db=Database.Open(“test”)中发现一个错误
连接字符串未找到

我是否缺少一些使用
语句的
?还是我做错了什么?

第一个问题是

我没有在web.config中定义连接字符串

我这样做了,它给了我一个
实例错误

这花了一段时间来解决奇怪的逃逸序列行为的原因。帮助了我