error constructor with no parameters does not exist

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UGF1bA==?=

    error constructor with no parameters does not exist

    Hi I am using a dataobject and trying to add two select parameters as follows:
    ObjectDataSourc e1.SelectParame ters.Clear();
    ObjectDataSourc e1.SelectParame ters.Add("Depar tmentID", ("1");
    ObjectDataSourc e1.SelectParame ters.Add("Activ e", "1");
    I get the error message that makes it appear that the parameters are not
    being added, thanks.
    --
    Paul G
    Software engineer.
  • Mark Fitzpatrick

    #2
    Re: error constructor with no parameters does not exist

    Did you retype the following code, or was it copied and pasted.
    ObjectDataSourc e1.SelectParame ters.Add("Depar tmentID", ("1");

    I ask because if you notice, you are passing the second parameter as ("1"),
    which is incorrect. In this case just remove the extra ( right before the
    "1";

    The next issue though, would be the "1". Are you trying to pass a default
    value? If so then you'll need to look closer at the parameter constructor
    definition. It expects the second parameter passed into the constructor to
    be a TypeCode as in
    ObjectDataSourc e1.SelectParame ters.Add("Depar tmentID",TypeCo de.Int32);
    that could also get you an error if you are trying to pass a default value
    isntead.

    Hope this helps,
    Mark Fitzpatrick
    Microsoft MVP - Expression

    "Paul" <Paul@discussio ns.microsoft.co mwrote in message
    news:1276B49A-F782-42CA-9163-E5754C5D3AC9@mi crosoft.com...
    Hi I am using a dataobject and trying to add two select parameters as
    follows:
    ObjectDataSourc e1.SelectParame ters.Clear();
    ObjectDataSourc e1.SelectParame ters.Add("Depar tmentID", ("1");
    ObjectDataSourc e1.SelectParame ters.Add("Activ e", "1");
    I get the error message that makes it appear that the parameters are not
    being added, thanks.
    --
    Paul G
    Software engineer.

    Comment

    Working...