string command = "SELECT COUNT(*) AS Expr1 " + " FROM Warehouse1Movements " + " WHERE (Deleted = 0) AND (OutDate=@OutDate) AND (LocationNumber = @LocationNumber)"; SqlConnection conn = new SqlConnection(Properties.Settings.Default.ICSDB); conn.Open(); SqlCommand cmd = new SqlCommand(command, conn); cmd.Parameters.Add("@LocationNumber", SqlDbType.Int).Value = locationNumber; cmd.Parameters.AddWithValue("@OutDate", DBNull.Value); int count = 0; int.TryParse(cmd.ExecuteScalar().ToString(), out count); conn.Close();
string command = "SELECT COUNT(*) AS Expr1 " + " FROM Warehouse1Movements " + " WHERE (Deleted =0) AND (OutDate IS NULL) AND (LocationNumber = @LocationNumber)"; SqlConnection conn = new SqlConnection(Properties.Settings.Default.ICSDB); conn.Open(); SqlCommand cmd = new SqlCommand(command, conn); cmd.Parameters.Add("@LocationNumber", SqlDbType.Int).Value = locationNumber; int count = 0; int.TryParse(cmd.ExecuteScalar().ToString(), out count); conn.Close();
(Isnull(OutDate,'Jan 01 1900')=Isnull(@OutDate,'Jan 01 1900'))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)