Subject: Beginner's question
Posted By: savoym Post Date: 1/8/2004 2:34:45 PM
I am very new to C#. To be honest I am not very clear on what is causing my problems.  A colleague has been helping me but I am getting a lot of errors.  Here is my code below and then the errors I am getting under that and any help or direction would be appreciated:

private void btnInvoiceSearch_Click(object sender, System.EventArgs e)
{
  Cursor.Current    = Cursors.WaitCursor;

// Identify the variables from the form elements to pass to the stored procedure in the PSSBilling_WebService
  string lstringClientID = txtClientID.SelectedText;
  int lintMonthText = lstMonthText.SelectedIndex + 1;
  string lstringYearText = lstYearText.SelectedItem;

  InvoiceList il = new InvoiceList();
  lblCount.Text = il.load( lstringClientID, lintMonthText, Convert.ToInt16( lstringYearText ).ToString());
        }

This code is within my Form.  The first bolded item tells me CANNOT IMPLICITLY CONVERT TYPE 'OBJECT' TO 'STRING'.  I don't know what to do to fix it.

The second bolded item tells me NO OVERLOAD FOR METHOD 'LOAD' TAKES '3' ARGUMENTS.

ANY HELP would be appreciated.  I am finding hard to follow this code.  I've been reading a lot but still struggling.

Thank you.
Reply By: KABay Reply Date: 1/8/2004 2:51:02 PM
Try ...

string lstringYearText = lstYearText.SelectedItem.ToString();

As far as il.load (whatever an 'InvoiceList' is) is concerned I would say the 'load' method does not have version with a parameter list that takes three parameters. You are trying to pass an incorrect number of parameters (too many/few?). Or else you need to define a version of the method that does take the three parameters you seem to want to pass.
Reply By: savoym Reply Date: 1/8/2004 2:58:48 PM
KABay,

Thanks for the response.  Your help is appreciated.  I will give that a try.

Go to topic 8354

Return to index page 973
Return to index page 972
Return to index page 971
Return to index page 970
Return to index page 969
Return to index page 968
Return to index page 967
Return to index page 966
Return to index page 965
Return to index page 964