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 1095561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:08:44+00:00 2026-05-17T00:08:44+00:00

For example, when creating a command text for a SqlServer ce statement, the example

  • 0

For example, when creating a command text for a SqlServer ce statement, the example has you use

command.CommandText = "INSERT INTO Region (RegionID, RegionDescription) VALUES (@id, @desc)";

I understand how to run sql queries, but have always just passed the database system a string with sql statements. This is new to me, and I would like to understand. Does the @ mean that it is a variable, so when it parses the string, it will insert the value of the variable id into the string where it says @id?
I know in php, double quotes allow the parser to parse a variable value within a string, and am wondering if this is similar.
However, to test it, I made a simple program to test this theory.

string id = "FOO";
MessageBox.Show("@id"); 

It showed the literal @id, so this has left me confused. Thanks ahead for any help!
I just feel the need to understand what I am typing, not just mindlessly following the examples.

  • 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-17T00:08:45+00:00Added an answer on May 17, 2026 at 12:08 am

    In this case @ defines the variable that you want to pass into your SQL statement.

    For instance:

    SqlParameter param  = new SqlParameter();
    param.ParameterName = "@id";
    param.Value         = 666;
    

    And then you add it to your command like that:

    command.Parameters.Add(param);
    

    Then, in your select @id and @desc will use values passed as a value of SqlParameter.

    Therefore, if you just output "@id" it will be interpreted as a normal string. It only makes sense while used inside a SQL query.

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

Sidebar

Related Questions

I have some difficulties with understanding BindingSource's behaviour. Let's look at following example: Creating
I'm following this example for creating a simple Web application using JAX-RS, MongoDB and
If you look at the NerdDinner example of creating and editing dinners then you
I have a demo app which is supposed to be an example of creating
I'm creating simple example on JSF. It's small Login application. My problem is duplicate
For example: I'm creating a CSV file and I have a CsvOptions object which
Am creating a Facebook like chat application.(Say for example am chatting with 4 users)
For example, say I'm creating a table which stores promo codes for a shipping
I am creating URLs in my website as http://example.com/register/ http://example.com/login/ I am creating above
For example, if I am creating a 3 layer application (data / business /

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.