一般我們能過vs2005的sql explorer來添加一個本地的mdf文件。也許你可能會出現下面這個問題:
exception details: system.data.sqlclient.sqlexception: the user instance login flag is not supported on this version of sql server. the connection will be closed.
通過搜索。發現這里有我們所需要的信息:error message: the user instance login flag is not supported on this version of sql server. the connection will be closed
仔細分析scott的回答:
"the issue is that user instancing, which allows the automatic creation of databases from code, isn't support on the full version of sql 2005. that is a function of sql express only. the solution is to manually create the database in sql server 2005 and set a connection string to point to it. you will also need to run aspnet_regsql.exe manually against the database if you will be using any of the new built-in database features of asp.net v2.0."
因此,如果我們不是使用的從ms下載下來的sql server 2005 express,那么我們只能過過在sql2005管理器上把mdf文件添加進去在連接它。
解決方法:在sql2005管理器上,通過attach(附加)本地的mdf文件成功之后。在vs2005的sql explorer的連接即可。
以后繼續補充。
cnzc's blogs
新聞熱點
疑難解答
圖片精選