【问题标题】:connecting to sql database in windows store app c# xaml在windows store app c# xaml中连接到sql数据库
【发布时间】:2015-07-15 17:04:42
【问题描述】:

如何在Visual Studio 2013的Windows Store App中连接sql数据库??

我可以像这样在 Windows 窗体应用程序中连接并在 sql 数据库上运行查询

SqlConnection conn = new SqlConnection("Data Source=JOHNDON;Initial Catalog=Register;Integrated Security=True");
        SqlCommand cmd = new SqlCommand("insert into Student values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')", conn);
        conn.Open();
        cmd.ExecuteNonQuery();
        MessageBox.Show("Submit Successfully");
            conn.Close();

现在我也想在 Windows Store App 中做同样的事情 请帮忙..谢谢

【问题讨论】:

    标签: c# sql wpf xaml windows-store-apps


    【解决方案1】:

    【讨论】:

    • 感谢您的回复..您能否详细解释一下在第 2 步中具体要做什么..因为我正在获取“实体数据模型向导”,但他们没有告诉任何相关内容
    • 这取决于 VS 设置和版本。试试stackoverflow.com/questions/12933767/…
    • 没有帮助..有没有其他方法可以做到这一点..请帮帮我伙计??
    • 抱歉,不知道其他解决方案。服务,再次,在微软的代码 sn-ps 中:code.msdn.microsoft.com/windowsapps/…
    猜你喜欢
    • 1970-01-01
    • 2017-04-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多