Можно ли использовать SQLParameter только с SQLCommand? Я хотел бы использовать параметры в функции DataTable.Compute(), но я не уверен, как это сделать правильно. Вот моя частичная функция:
Код: Выделить всё
private void UpdateDeptBudget(int departmentId, int yearCode, int orderNum)
{
// get the order total
using (conn)
{
DataSet ds = new DataSet();
DataTable dt = ds.Tables["OrderItems"];
object orderTotal = dt.Compute("SUM(itemTotal)", "orderId = " + orderNum);
.
.
.
}
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... le-compute