473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

error constructor with no parameters does not exist

Hi I am using a dataobject and trying to add two select parameters as follows:
ObjectDataSource1.SelectParameters.Clear();
ObjectDataSource1.SelectParameters.Add("Department ID", ("1");
ObjectDataSource1.SelectParameters.Add("Active", "1");
I get the error message that makes it appear that the parameters are not
being added, thanks.
--
Paul G
Software engineer.
Jun 27 '08 #1
1 1063
Did you retype the following code, or was it copied and pasted.
ObjectDataSource1.SelectParameters.Add("Department ID", ("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
ObjectDataSource1.SelectParameters.Add("Department ID",TypeCode.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" <Pa**@discussions.microsoft.comwrote in message
news:12**********************************@microsof t.com...
Hi I am using a dataobject and trying to add two select parameters as
follows:
ObjectDataSource1.SelectParameters.Clear();
ObjectDataSource1.SelectParameters.Add("Department ID", ("1");
ObjectDataSource1.SelectParameters.Add("Active", "1");
I get the error message that makes it appear that the parameters are not
being added, thanks.
--
Paul G
Software engineer.
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ook | last post by:
Here is my code, can some kind soul tell me what I'm doing wrong, or why I get this compile error, and maybe what to do to prevent it? I think I must be missing some fundamental concept here, or...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
12
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport)...
3
by: MovnOn | last post by:
I've created an installation package for my program. Before installation, I use the User Interface to get values that are added to the registry. One of the values that the user must add is a path...
3
by: John Shell | last post by:
Hello, all. The following code results in a C2666 error (2 overloads have similar conversions). class FSVec2D { public: FSVec2D() { // code omitted }
6
by: rn5a | last post by:
During registration, users are supposed to enter the following details: First Name, Last Name, EMail, UserName, Password, Confirm Password, Address, City, State, Country, Zip & Phone Number. I am...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
2
by: ali | last post by:
Hi, I was reading on inheritance and constructors on a text, and the author was saying that its a good practice to include a default constructor even if we have overloaded constructors. I don't...
74
by: Zytan | last post by:
I have a struct constructor to initialize all of my private (or public readonly) fields. There still exists the default constructor that sets them all to zero. Is there a way to remove the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.