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

  • Home
  • SEARCH
  • 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 6971139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:48:03+00:00 2026-05-27T16:48:03+00:00

I am just carrying out a query, and have started using parameters. And all

  • 0

I am just carrying out a query, and have started using parameters. And all was going great, until a null string is passed. It worked fine before, using "name = " + Name Where name may or maynot be null.

Is there as simple way around this?

Also on the topic, I havent tried it yet, but can I identify parameters by anything other than numbers. It is a potential area to go wrong, having 14 number parameters with no identification to which is which, except hoping they are in the correct order. (What if i come to add another in)

Error message : The parameterized query '(@0 nvarchar(5),@1 nvarchar(4),@2 nvarchar(4000),@3 nvarchar(400' expects the parameter '@2', which was not supplied.

The Parameterised query:

            db.Execute("Update User SET Name = @0 , Address1 = @1 , Address2 = @2 , Address3 = @3, Address4 = @4 , Postcode = @5 , Title = @6, " +
                        " Surname = @7 , Forename = @8 , Tel = @9, Fax = @10 , Mobile = @11 , Email = @12  WHERE UserNo = @13",
                        Name, Address1, Address2, Address3, Address4, Postcode, Title, Surname, Forename, Tel, Fax, Mobile, Email, UserNo);
  • 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-05-27T16:48:04+00:00Added an answer on May 27, 2026 at 4:48 pm
    db.Execute("Update User SET Name = @0 , Address1 = @1 , Address2 = @2 , Address3 = @3, Address4 = @4 , Postcode = @5 , Title = @6, " +
                            " Surname = @7 , Forename = @8 , Tel = @9, Fax = @10 , Mobile = @11 , Email = @12  WHERE UserNo = @13",
                            (Name==null)?"":Name, (Address1==null)?"":Address1, ...);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just recently started carrying out unit testing for my software written in
Just want to confirm with the COM/DCOM experts out there... I have a Delphi
Let's say I have a CString variable carrying the string Bob Evans. I want
I have a midterm coming up next week and I was just going over
I am carrying out code maintenance on an old Python script. I have come
just a quick question: I am a CS undergrad and have only had experience
Just how much slower are events? I have written a streaming XML parser (that
Just found this out, so i am answering my own question :) Use a
I'm carrying out some experiments in theorem proving with combinator logic, which is looking
Just wanted to know question w.r.t Currying If we have defined the curried function

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.