Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. The parameter is incorrect

The parameter is incorrect

Scheduled Pinned Locked Moved C#
help
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NiloofarNoroozi
    wrote on last edited by
    #1

    hi i use these codes for reporting my proc:

    create proc Cpost
    @nopersoneli int
    As
    Select p.fname,p.lname,p.NoPersoneli,po.name from personal p
    Join postpersonal pp
    On p.NoPersoneli=pp.Cpersonal
    Join post po
    On po.code=pp.vpost

    ReportDocument reportDocument = new ReportDocument();
    ParameterField paramField = new ParameterField();
    ParameterFields paramFields = new ParameterFields();
    ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
    paramField.Name = "@NoPersoneli";
    paramDiscreteValue.Value = "45";
    paramField.CurrentValues.Add(paramDiscreteValue);
    paramFields.Add(paramField);
    crystalReportViewer1.ParameterFieldInfo = paramFields;
    reportDocument.Load(@"C:\Documents and Settings\Administrator\Desktop\VEZARAT\VEZARAT\PostCrystalReport.rpt");
    reportDocument.SetDatabaseLogon("", "", "niloofar\\i2", "vezaratekar", false);
    crystalReportViewer1.ReportSource = reportDocument;

    error:The parameter is incorrect please help to me thanks a lot

    A 1 Reply Last reply
    0
    • N NiloofarNoroozi

      hi i use these codes for reporting my proc:

      create proc Cpost
      @nopersoneli int
      As
      Select p.fname,p.lname,p.NoPersoneli,po.name from personal p
      Join postpersonal pp
      On p.NoPersoneli=pp.Cpersonal
      Join post po
      On po.code=pp.vpost

      ReportDocument reportDocument = new ReportDocument();
      ParameterField paramField = new ParameterField();
      ParameterFields paramFields = new ParameterFields();
      ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
      paramField.Name = "@NoPersoneli";
      paramDiscreteValue.Value = "45";
      paramField.CurrentValues.Add(paramDiscreteValue);
      paramFields.Add(paramField);
      crystalReportViewer1.ParameterFieldInfo = paramFields;
      reportDocument.Load(@"C:\Documents and Settings\Administrator\Desktop\VEZARAT\VEZARAT\PostCrystalReport.rpt");
      reportDocument.SetDatabaseLogon("", "", "niloofar\\i2", "vezaratekar", false);
      crystalReportViewer1.ReportSource = reportDocument;

      error:The parameter is incorrect please help to me thanks a lot

      A Offline
      A Offline
      Alan Balkany
      wrote on last edited by
      #2

      Can you tell us which line is associated with the error?

      N 1 Reply Last reply
      0
      • A Alan Balkany

        Can you tell us which line is associated with the error?

        N Offline
        N Offline
        NiloofarNoroozi
        wrote on last edited by
        #3

        program run when form opens i see this error

        A 1 Reply Last reply
        0
        • N NiloofarNoroozi

          program run when form opens i see this error

          A Offline
          A Offline
          Alan Balkany
          wrote on last edited by
          #4

          Put a breakpoint on the line "ReportDocument reportDocument = new ReportDocument();", and run the program with the debugger (F5). After it stops on this line, hit F10 to execute one line at a time. (The highlighted line is the line that will be executed when you hit F10.) Tell us which line produces the error.

          N 1 Reply Last reply
          0
          • A Alan Balkany

            Put a breakpoint on the line "ReportDocument reportDocument = new ReportDocument();", and run the program with the debugger (F5). After it stops on this line, hit F10 to execute one line at a time. (The highlighted line is the line that will be executed when you hit F10.) Tell us which line produces the error.

            N Offline
            N Offline
            NiloofarNoroozi
            wrote on last edited by
            #5

            i have error in this line: paramField.Name = "@NoPersoneli"; thanks a lot

            A 1 Reply Last reply
            0
            • N NiloofarNoroozi

              i have error in this line: paramField.Name = "@NoPersoneli"; thanks a lot

              A Offline
              A Offline
              Alan Balkany
              wrote on last edited by
              #6

              Does the ParameterField class have a Name member? If it doesn't, that may account for the error message.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups