1
Searchテキストボックスに挿入されている値よりも少ない在庫を持つすべての製品をレポートに表示させたい。エラーがあります。レポートビューアでパラメータを設定
これはストアドプロシージャです:ユーザーが検索テキストボックスに値を入力するとき
CREATE PROCEDURE [dbo].[GetInventoryReport]
@Stock int
AS
SELECT *
FROM Product
WHERE Stock < @Stock
ORDER BY Stock ASC
これはコードです。
private DataTable GetInventoryReport_Result()
{
DataTable dtbl = new DataTable();
try
{
SqlCommand sqlCmd = new SqlCommand("GetInventoryReport", sqlCon);
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.Parameters.AddWithValue("@Stock", txtSearch.Text.Trim());
SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);
sqlDa.Fill(dtbl);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error Message");
}
finally
{
if (sqlCon != null)
sqlCon.Close();
}
return dtbl;
}
エラー:
'Microsoft.Reporting.WinForms.LocalReport' does not contain a definition for 'Add' and no extension method 'Add' accepting a first argument of type 'Microsoft.Reporting.WinForms.LocalReport' could be found (are you missing a using directive or an assembly reference?)