Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 8th, 2004, 03:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default Beginner's question

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.
 
Old January 8th, 2004, 03:51 PM
Authorized User
 
Join Date: Nov 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to KABay
Default

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.
 
Old January 8th, 2004, 03:58 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default

KABay,

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
A beginner's question Gene Reginato XSLT 5 May 17th, 2007 10:32 AM
Beginner's Question peytontodd Beginning VB 6 3 March 7th, 2007 11:58 AM
Beginner's question re: WindowsForm DataGrid savoym C# 2 January 19th, 2004 02:51 PM
Help please: another beginner's question savoym C# 1 January 9th, 2004 11:45 AM
Beginner's SQL question pankaj_daga SQL Language 3 November 12th, 2003 07:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.