开发者

How can I view the data in an SQLEXPRESS DB which is connected in Web.config?

I'm running Visual Web Developer 2010 Express. I have added an additional SQLExpress DB to the standard ASPNETDB.mdf. Both are connected through the web.config. Everything runs fine. The connection strings are as follows:

<add name="TrempimModel"
     connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|TrempimModel.mdf;
     database=TrempimModel;User Instance=true"
     providerName="System.Data.SqlClient" />
<add name="ApplicationServices"
     connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;
     User Instance=true"
     providerName="System.Data.SqlClient" />

But how do I view the data in both DB files? To my surprise, a开发者_JS百科lthough the files are refferenced in web.config, the DB Explorer in the IDE does not show them. If I go and add either or both in the DB explorer, strange stuff starts happening - mainly the application is not able to connect to my added DB at application launch.

So what is the best way to view SQL Express table data? Is it through the IDE, or a seperate application? And why isn't the DB explorer showing a connection established in web.config?

Thanks,

Gil


Problem Solved - surprisingly enough, by eliminating the connection sting altogether. That way, the database is created by the DB engine and attached automatically by Management Studio, so the data can be viewed over there, while debugging.

I wander why all the walk-through descriptions eliminate this option which is as hassle free as they come... One point to remember is that you need to exit the Management Studio before running the application with data model changes that will cause the DB to be re-created.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜