String sqlconn = "Data Source=wei//SQLEXPRESS;Initial Catalog=HISDB;Integrated Security=True";
SqlConnection weida = new SqlConnection(sqlconn);
weida.Open();
//*********************
string sql = "SELECT tkdh FROM tkxx WHERE checked = 'True' AND tkdh='" + ckdh + "'";
SqlCommand check1 = new SqlCommand(sql, weida);
int j = Convert.ToInt32(check1.ExecuteScalar());
if (j > 0) //存在
{
Response.Write("<script language='javascript'>alert('该出库记录已经执行退库操作,不能重复退库');</script>");
}
else
{
}
检查退库记录
本文介绍了一段使用 C# 和 SQL 对已存在的退库记录进行检查的代码片段。通过连接 HISDB 数据库,此代码判断指定出库单号是否已执行过退库操作。

被折叠的 条评论
为什么被折叠?



