在windows store app c#xaml中连接到sql数据库

时间:2015-07-15 17:04:42

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

如何在Visual Studio 2013中连接到Windows应用商店中的sql数据库??

我可以在Windows Forms Application中连接并运行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应用商店应用中也这样做 请帮助..谢谢

1 个答案:

答案 0 :(得分:1)