locked
expects parameter '@AppEmployeeID', which was not supplied. SQL State: 42000 Native Error RRS feed

  • Question

  • User-102500655 posted

    Failed to open a rowset. Details: ADO Error Code: 0x Source: Microsoft SQL Native Client Description: Procedure or function 'usp_FMS_TotalConsumed_thismonth' expects parameter '@AppEmployeeID', which was not supplied. SQL State: 42000 Native Error: Failed to open a rowset. Error in File C:\Users\PKKHUR~1\AppData\Local\Temp\TransactionField {F6DDC345-30BC-4D3F-A8B6-890EA574C233}.rpt: Failed to open a rowset.

    report was working fine at local system and even on test server but as soon as i move it to live or connect to live db it start giving me error

    Thursday, December 8, 2011 12:32 AM

All replies

  • User-260044566 posted

    Hi,

    Make sure in your code whenever you are calling usp_FMS_TotalConsumed_thismonth stored procedure you have assigned value for @AppEmployeeId parameter which was being used by that stored procedure. If you don't want to assign it and if it was a optional value to be passed to the stored procedure then assign default value for that parameter in the stored procedure as,

    @AppEmployeeId datatype Default value

    Thursday, December 8, 2011 1:12 AM
  • User-102500655 posted

    i am assigning stroreprocedure to report...when i create that report..now from front end i am passing variable and setting its value but still it is giving me eroor...i don't understand i m missing some thing litle

    Thursday, December 8, 2011 1:27 AM
  • User-260044566 posted

    Can you post your code for assigning parameter and executing stored procedure.

    Thursday, December 8, 2011 1:31 AM
  • User1196771204 posted

    The error message: "Failed to open a rowset. Details: ADO Error Code: 0x Source: Microsoft SQL Native Client Description: Procedure or function 'usp_FMS_TotalConsumed_thismonth' expects parameter '@AppEmployeeID', which was not supplied" clearly indicates that the issue is with your code-behind.

    You  have a stored procedure called usp_FMS_TotalConsumed_thismonth and this sp expects @AppEmployeeID . However, you forgot to pass along this parameter on your code-behind. Please double check your code-behind again.

    Please mark this response as an "answer" if it helps you. Thanks heaps 

    Thursday, December 8, 2011 1:35 AM
  • User-102500655 posted

    here i am passing parameter ..it was working fine on my preprod and start raising error when i deployed it to live server

    string reportpath = Server.MapPath("TransactionReport.rpt");

    rpt.Load(reportpath);

    ConnectionInfo connectionInfo = new ConnectionInfo();

    SqlConnectionStringBuilder conStr = new SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings["DBConnString"].ConnectionString);

    rpt.SetDatabaseLogon(conStr.UserID, conStr.Password, conStr.DataSource, conStr.InitialCatalog,

    false);

    rpt.DataSourceConnections[0].SetConnection(conStr.DataSource, conStr.InitialCatalog,

    false);

    rpt.DataSourceConnections[0].SetLogon(conStr.UserID, conStr.Password);

    rpt.SetParameterValue(

    "@AppEmployeeID", Convert.ToInt16(employee_id));

    DateTime myDateTime = DateTime.Now;

    bool type=Convert.ToBoolean(ViewState["TYPE"]);

    int month = Convert.ToInt16(ViewState["month"]);

    rpt.SetParameterValue(

    "@month", month);

    rpt.SetParameterValue(

    "@TYPE", type);

    CrvTransaction.ReportSource = rpt;

     

    Thursday, December 8, 2011 4:21 AM