sql怎样插入数据啊
好奇怪,我在我的电脑上作的一个简单的留言板,留言成功,一切正常,于是我就把它弄到服务器上去,结果什么现象都没有,不管用不用存储过程在我电脑上都正确而服务器总是没有反应
ConnectionStringSettings setting = System.Configuration.ConfigurationManager.ConnectionStrings["masterConnectionString"];
SqlConnection conn = new SqlConnection(setting.ConnectionString);
conn.Open();
SqlCommand cmd = new SqlCommand("insert into talk (text) values (@text)", conn);
//cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@text", SqlDbType.NVarChar);
cmd.Parameters["@text"].Value = this.content1.Value;
cmd.ExecuteNonQuery();
conn.Close();
this.content1.Value = "";
就连最后一句this.content1.Value = "";清空留言框都不执行了,不报错,
从我的测试数据看,连接也就没问题了,就如这个画面一样,我点了 确认留言 后,还是这副画面
Connection String是否正确呢?
从你的描述看可能这个过程没有执行,单步跟踪看下
file:///C:/Documents%20and%20Settings/Administrator/桌面/QQ截图未命名.jpg
应该是你的连接字符不对了,单步跟踪下
恩,同意4楼的看法
应该检
相关问答:
DateTime startTime=DateTime(em_1.Text)
DateTime endTime=DateTime(em_2.Text)
string sql
sql = dw_1.GetSQLSelect()+"Where (StartTime> '"+startTime+"') and (EndTime ......
小弟最近遇到一个问题,要求得出哪个班级的教师待遇最高,把同一个班级的教师待遇合计起来
班级表 教师表
班级ID & ......
求A != 1 and B != 2 以外的记录
a!=1 and b!=2 以外?
那岂不是a=1或者b=2的这种情况么
select * from table where a = 1 or b = 2
如果是A != 1 and B != 2的话
select * from table where a ......
表结构 为
id parentid name
1 0
2 0
3 1
4 3
5 2
输入0现在想得到
4 5
也就是获取叶子节点,改怎么实现? 谢谢
......