table名错误了,不是"Upload_AV",而是"dept"
解决方案 »
- 关于限定输入的问题asp.net验证控件
- aspx伪静态问题???????????????????~~~~~~~~~
- 请问在页面中怎样释放掉某个ViewState[]变量?
- |M| 在做查询的时候大家都是怎么来写SQL的 下面是我的写法看看大家怎么写
- WebHtmlEditor 1.5 Release提供下载,提供源码
- 当执行安装程序途中,提示insert DISK1,但插入DISK1还是没有用
- web下报表打印时的页面设置问题
- 程序打包的问题
- MVC中视图页面循环点击按钮 添加文本框
- 难题,请教...
- 请教各位:如何控制web control的按“enter”的事件!
- 求一元三次方程算法,,100point
{
SqlConnection myConnection =
new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
string selectCmd = "select dept_id from dept where dept_name = '"+deptname+"'";
SqlCommand Comm=new SqlCommand(selectCmd,myConnection);
SqlDataReader Reader=Comm.ExecuteReader();
//有数据为True,反之
if (Reader.Read())
{
this.TextBox1.Text=Reader["dept_id"].ToString():
}
else
{
//没有数据
}
{
提示重复
}
else
{
插入
}