Results 1 to 3 of 3

Thread: Overload resolution failed

  1. #1
    Join Date
    Feb 2009
    Posts
    78

    Overload resolution failed

    I have a vb.net function that expects 2 parameters - example :
    GetCustomer(byval Addr1 as string, byval Addr2 as string).
    The calling program calls this function by passing 2 string variables,example:
    myCustomer = GetCustomer(strAddr1, strAddr2)

    The function works well when both strAddr1 and strAddr2 have string values. However, sometimes strAddr2 is NULL. In that case, when the function is called, I get an error: Overload resolution failed because no Public 'GetCustomer' is most specific for these arguments..

    These are just examples from a more complex requirement, but the parameters being passed may be nulls, string or integers and one function needs to handle them all without creating multiple overloaded copies.

    Thanks.

  2. #2
    Join Date
    Jan 2009
    Posts
    120

    Re: Overload resolution failed

    You missed one small step when setting up the databindings for the viewer.
    You correctly went into the DataBindings dialog box and selected the cached report. HOWEVER, on the left hand side of the dialog box, you should have first selected the property "ReportSource". Instead, you left it at the default property AccessKey. This results in the databindings trying to assign the cached report to the AccessKey property instead of the ReportSource property.

    Once you fix that, you should be good to go!

  3. #3
    Join Date
    Jan 2009
    Posts
    143

    Re: Overload resolution failed

    Hi,

    I can provide you some sort of code here.

    You don't need to use Session to save the object, such as DataSet, in page. For example, you use the following code to call the stored procedure:

    Code:
    Public Sub SelectCustomer()
        Dim connection As SqlConnection = _
            New SqlConnection(connectionString)
        connection.Open()
        Try
    
            Dim command As SqlCommand = _
                New SqlCommand("SelectCustomer", _ connection)
            command.Parameters.Add("@CustomerID", "PAULK")
            command.CommandType = CommandType.StoredProcedure
    
            Dim adapter As SqlDataAdapter = New SqlDataAdapter(command)
    
            Dim table As DataTable = New DataTable
            adapter.Fill(table)
    
        Catch ex As Exception
            Console.WriteLine(ex.Message)
            Throw
        Finally
            connection.Close()
        End Try
    End Sub

Similar Threads

  1. System overload in Skype
    By pasture in forum Technology & Internet
    Replies: 2
    Last Post: 16-10-2011, 06:50 AM
  2. System overload due to malware
    By Omanand in forum Networking & Security
    Replies: 5
    Last Post: 16-07-2011, 08:19 PM
  3. how to overload a function in c++
    By Calandar in forum Software Development
    Replies: 4
    Last Post: 08-01-2011, 10:32 AM
  4. Overload SET accessor in C#
    By $tatic in forum Software Development
    Replies: 3
    Last Post: 31-03-2009, 10:02 PM
  5. Suffering from 100% cpu overload
    By Renderman21 in forum Windows Software
    Replies: 4
    Last Post: 13-08-2008, 02:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,383,075.84871 seconds with 16 queries