[英]How to stop visual studio from opening my winforms controls in the designer
[英]Winforms app not opening on a second computer where Visual Studio is not installed
我有两台电脑。 首先是MacBook Air,我使用的是Visual Studio 2015和SQL Server 2014 Express。 我正在编写WinForms应用程序,然后在另一台计算机Sony上尝试。 当我只编写WinForms功能并在Sony中尝试时,没有问题。 WinForms应用程序运行正常。
但是,当我编写与数据库相关的WinForms应用程序时,该应用程序无法在第二台计算机(Sony)上运行。 单击.exe文件时没有任何反应。 索尼也安装了SQL Server 2014 Express,但未安装Visual Studio。
我正在使用Linq to SQL类与.mdf
文件进行连接。 这是我的简单测试示例:
readolny LtoSQLDataContext _db = new LtoSQLDataContext();
var all = _db.articles; // The table's name is article.
Radlabel1.Text = "<html>There are <b>" + all.Count() + "</b> articles in our database.";
这是打印屏幕图像:
该代码在第二台计算机上不起作用。 而是,当单击.exe
文件时,Winforms应用程序不会打开。 问题出在哪儿?
当我使用try catch
块时,我可以捕获错误。 在此之后,我放弃了使用SQL Server。 在我的单用户项目中,我使用SQLite。 非常好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.