Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9134223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:37:18+00:00 2026-06-17T08:37:18+00:00

We have this query for a strongly typed DataSet which as created in the

  • 0

We have this query for a strongly typed DataSet which as created in the Visual Studio DataSet Designer:

SELECT ID, PaymentAmount, PaymentDate, WhatWasPaymentFor
  FROM Payments
 WHERE ParentID = @ParentID
   AND (@PaymentDate is null OR PaymentDate = @PaymentDate)
   AND (@PaymentAmount is null OR PaymentAmount = @PaymentAmount)
   AND ((@SearchValue is null OR 
       (WhatWasPaymentFor LIKE '%' + @SearchValue  + '%' OR @SearchValue='ALL'))
       )

In a VB.Net code-behind file we call the query to fill the DataSet like this:

Dim tblObject = theTableAdapter.GetDataByAllInOne(dcmParentsId, Nothing, Nothing, TextBoxSearch.Text)

Intellisense shows the 4th parameter as being a Decimal when I thought it would be a String. I found this out when the mouse is over the parameter for @SearchValue.

When this coding is executed, this error is displayed:

Conversion from string "Books" to type 'Decimal' is not valid.

The only column in this query that is a Decimal is PaymentAmount which happens to be the 3rd parameter not the 4th one.

I’m not sure why intellisense states that the 4th parameter @SearchValue is a Decimal. Can you show me how to change it to a String?

An interest thing that does happen is that the query will work ok if run in the SQL Server Magagement Studio as:

DECLARE @SearchValue VARCHAR = 'Books'
DECLARE @ParentID    INT = 3
DECLARE @PaymentDate DATETIME = NULL
DECLARE @PaymentAmount MONEY = NULL

SELECT ID, PaymentAmount, PaymentDate, WhatWasPaymentFor
  FROM Payments
 WHERE ParentID = @ParentID
   AND (@PaymentDate is null OR PaymentDate = @PaymentDate)
   AND (@PaymentAmount is null OR PaymentAmount = @PaymentAmount)
   AND ((@SearchValue is null OR 
    (WhatWasPaymentFor LIKE '%' + @SearchValue  + '%' OR @SearchValue='ALL'))
       )

Maybe there is something that needs to be set in the DataSet designer I’m not aware of.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:37:19+00:00Added an answer on June 17, 2026 at 8:37 am

    In the designer, the query will display the parameters it expects in the order it expects them ie you should see something like GetDataByAllInOne(@ParentID,@PaymentDate,@PaymentAmount,@SearchValue).
    Can you check this first?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strongly-typed DataTable returned in a strongly-typed DataSet from a database query.
I have strongly typed dataset. Now I want to do a select on a
I have this query in sql server 2000: select pwdencrypt('AAAA') which outputs an encrypted
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
I have this query... SELECT Distinct([TargetAttributeID]) FROM (SELECT distinct att1.intAttributeID as [TargetAttributeID] FROM AST_tblAttributes
I have this query which on executing in my sql command line client executes
i have this query: SELECT `completed`.`ID` AS `ID`,`completed`.`level` AS `level`,`completed`.`completed_in` AS `completed_in`, COUNT(1) AS
I have this query SELECT zip, ( 3959 * acos( cos( radians(34.12520) ) *
I have this query, which is giving me some problems... I am trying to
I have this query which is a dependant query and taking much execution time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.