ASP.NET C#无法在表中插入数据的问题 [英] ASP.NET C# Problem not inserting data in table

查看:52
本文介绍了ASP.NET C#无法在表中插入数据的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

建立服务数据库后如何在服务数据库中保存数据?我该如何部署窗口应用程序.
请帮助我
我已经建立了服务数据库并创建了连接,但是值未插入
我的连接和sql commond是---

How to save data in my service database after made service database what can I deploye window application.
please help me
I have made service database and creat the connection but value is not inserting
my connection and sql commond is---below

 private void button1_Click(object sender, EventArgs e)
{
    SqlConnection CON = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database1.mdf;Integrated Security=True;User Instance=True");
    CON.Open();
    SqlCommand cm = new SqlCommand("insert into table3 (name) values(@name)", CON);
    cm.Parameters.AddWithValue("@name", textBox1.Text);
    cm.ExecuteNonQuery();
}


上面我的普通成功成功了,没有错误,但值未保存在数据库表中....我该怎么办


above my commond exicute sucsessfull and there is no error but value not save in database table....what can I do

推荐答案

您能否给出清晰的视图,如哪种类型错误和获取代码等
can u give clear view like what type of error u get and code etc


检查存储过程是否正常...
check storeprocdure which is working properly...


这篇关于ASP.NET C#无法在表中插入数据的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆