语句#34之间的"的SQL参数化查询;

时间:2014-06-08 22:19:06

标签: vb.net

您好我只是想知道这个SQL语句的正确参数是什么,这段代码的副本是用于过滤带行和行的日期范围

With cmd
        .Connection = conn
        .CommandText = "Select * from tbl_Production where (date between @datestart and @dateend) and (lineID = @lineID) and shiftID = @shiftID order by date asc"
        cmd.Parameters.Add(New SqlParameter("@datestart", CStr(dtpstart.Text)))
        cmd.Parameters.Add(New SqlParameter("@dateend", CStr(dtpend.Text)))
        cmd.Parameters.Add(New SqlParameter("@lineID", lineID))
        cmd.Parameters.Add(New SqlParameter("@shiftID", shiftID))
        cmd.Parameters.Clear()
    End With

谢谢

0 个答案:

没有答案