小编A_A*_*_AR的帖子

Hyper-V的替代方案,用于运行Windows Phone模拟器

我最近买了一台Windows 8笔记本电脑只是为了开发Windows Phone应用程序.我的不是专业版,因此​​Hyper-V无法运行.(我意识到购买笔记本电脑后Hyper-V需要WinPro).

我无法升级到专业版.任何人都可以建议我在我的模拟器可以运行的Hyper-V的任何替代品?谢谢.

hyper-v windows-8 visual-studio-2012 windows-phone-8 windows-phone-8-emulator

13
推荐指数
1
解决办法
2万
查看次数

从web.config文件获取sql连接字符串

我正在学习通过单击按钮从文本框写入数据库.我已经在我的web.config文件中指定了我的NorthWind数据库的连接字符串.但是,我无法访问后面的代码中的连接字符串.

这就是我尝试过的.

protected void buttontb_click(object sender, EventArgs e)
{
    System.Configuration.Configuration rootwebconfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/Mohtisham");
    System.Configuration.ConnectionStringSettings constring;
    constring = rootwebconfig.ConnectionStrings.ConnectionStrings["northwindconnect"];
    SqlConnection sql = new SqlConnection(constring);

    sql.Open();
    SqlCommand comm = new SqlCommand("Insert into categories (categoryName) values ('" + tb_database.Text + "')", sql);
    comm.ExecuteNonQuery();
    sql.Close();
}
Run Code Online (Sandbox Code Playgroud)

我得到一个工具提示错误

SqlConnection sql = new SqlConnection(constring);
Run Code Online (Sandbox Code Playgroud)

System.data.SqlClient.Sqlconnection.Sqlconnection(string)有一些无效的参数.

我想从负载连接字符串web.configconstring

c# sql-server asp.net connection-string web-config

11
推荐指数
2
解决办法
4万
查看次数