我有个借阅程序,当图号一样的只剩下一本时,禁止出库。但是我程序写了剩下一本时还是可以出库,看不出有什么问题,希望各位大虾指教下,感激感激
string sbth2 = this.TextBox25.Text;
string th2 = this.TextBox11.Text; string fs = "";
string SqlConn4 = System.Configuration.ConfigurationSettings.AppSettings["ConnString"];
SqlConnection Conn4 = new SqlConnection(SqlConn4);
Conn4.Open();
string SqlStr4 = "select sum(dqsl) as fs1 from sb_cktz where sbth='" + sbth2 + "' and th='" + th2 + "' ";
SqlCommand Comm4 = new SqlCommand(SqlStr4, Conn4);
SqlDataReader read4 = Comm4.ExecuteReader();
read4.Read();
fs = read4["fs1"].ToString();
if (fs == "1")
{
this.RegisterStartupScript("提示", " <script language=\"javascript\"> alert('该资料只剩下最后一套,不能借阅!'); </script> ");
read4.Close();
Conn4.Close();
return; }
string sbth2 = this.TextBox25.Text;
string th2 = this.TextBox11.Text; string fs = "";
string SqlConn4 = System.Configuration.ConfigurationSettings.AppSettings["ConnString"];
SqlConnection Conn4 = new SqlConnection(SqlConn4);
Conn4.Open();
string SqlStr4 = "select sum(dqsl) as fs1 from sb_cktz where sbth='" + sbth2 + "' and th='" + th2 + "' ";
SqlCommand Comm4 = new SqlCommand(SqlStr4, Conn4);
SqlDataReader read4 = Comm4.ExecuteReader();
read4.Read();
fs = read4["fs1"].ToString();
if (fs == "1")
{
this.RegisterStartupScript("提示", " <script language=\"javascript\"> alert('该资料只剩下最后一套,不能借阅!'); </script> ");
read4.Close();
Conn4.Close();
return; }
解决方案 »
- 为什么我收不到255.255.255.255广播的消息呢。。。那位大虾可以告诉我啊。。。急需啊。。急需。。谢谢啦!!
- 在数据库中更新图片 求帮助
- 我的VS2005(winform)这边可以改,那边可以调试?
- 浏览的问题
- winform中的gridview排序
- .net中密钥文件怎么生成及密钥文件有和作用?
- 关于C# WINFORM 两个Flash控件
- C# WinForm中 toolTip1.Show("投产时间", number16, 0, 0),当窗体移动时,tooltip不随着移动,能解决吗?
- 如何在C#中实现分时间点的动画
- =CE=A2=C8=ED=BF=AA=B7=A2=D5=DF=BE=E3=C0=D6=B2=BF 求助,给分不含糊!
- 简单问题
- 新手求助,大家来看一下
Comm4.ExecuteReader();只有一条记录,则用scaler好点吧.
为1 ClientScript.RegisterStartupScript
return;
if(read4.Read())
{
.....
}