none
overload for method - takes 1 argument RRS feed

  • Question

  • Hi,

    Fairly new to C# programming and Visual - and getting stuck in the first week with and error I can't resolve.

    Normally I would search the web, but I just can't get me head around the resolve for this type of error.

    The error line is "

    SearchJob

     

    job = searchMgr.SyncSearch(parameters);

    "
    ** No Overload for method 'SynchSearch' takes '1' argument.



    namespace

     

    WeblogReports

    {

     

    public class Model

    {

     

    private SearchManager searchMgr;

     

    private string connectedTo;

     

    public Model(string hostPath, string username, string password)

    {

     

    try

    {

     

    SplunkConnection con = new SplunkConnection(hostPath);

    con.Authenticate(username, password);

     

    SearchManager searchMgr = new SearchManager(con);

     

    this.searchMgr = searchMgr;

    connectedTo = hostPath;

    }

     

    catch (SplunkWebException ex)

    {

     

    MessageBox.Show(ex.Message + " " + ex.InnerException.Message);

    connectedTo =

    null;

    }

    }

     

    public string ConnectedTo

    {

     

    get { return connectedTo; }

    }

     

     

    private SearchEvent[] ExecuteSearch(DispatchParameters parameters)

    {

     

    SearchJob job = searchMgr.SyncSearch(parameters);

     

    SearchEvent[] results = job.GetResults(null);

    job.Cancel();

     

    return results;

    }

     

    public SearchEvent[] GetReferers(DispatchParameters parameters )

    {

    parameters.SearchString =

    "search sourcetype::access_* | top limit=10 referer_domain";

     

    return ExecuteSearch(parameters);

    }

    Monday, April 13, 2009 12:14 PM

Answers

  • Microsoft is pretty infamous for picking lousy names, but "Splunk" is unmatched.  Not an MSFT product, you'll have to find support at their site .
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Friday, April 17, 2009 11:11 AM
    Monday, April 13, 2009 12:27 PM
    Moderator

All replies

  • Microsoft is pretty infamous for picking lousy names, but "Splunk" is unmatched.  Not an MSFT product, you'll have to find support at their site .
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Friday, April 17, 2009 11:11 AM
    Monday, April 13, 2009 12:27 PM
    Moderator
  • See if the Intellisense provides any help on the arguments the SyncSearch Method expects.


    Ganesh Ranganathan
    [Please mark the post as answer if you find it helpful]
    Monday, April 13, 2009 12:48 PM
  • Hi Jaybode,

    You have to check the SearchManager class SyncSearch method, the problem is very clear, this method expects more or les than 1 parameter.

    regards,
    Abijah
    Tuesday, April 14, 2009 8:13 AM