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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:55:08+00:00 2026-06-05T22:55:08+00:00

//how to use the N character to make my program update Arabic Fields (first

  • 0

//how to use the N character to make my program update Arabic Fields (first name =”الاسم الاول”)…
I mean

UPDATE  students SET first_name = N'الاسم' , last_name = N'الاسم الاخير' , father_name = N'الاسم الاخير' , mother_name = '', birth_date = '1/1/1990 12:00:00 AM' , education_level = '' , address = '' , notes = '' WHERE student_id = 33

//this command in MSSQL-Server but I am trying to use the UPDATE command in my C# program

 public string student(int id, string first_name, string last_name, string father_name, string mother_name, DateTime birth_date, string education_level, string address, 
         int[] phone_numbers, int[] old_phone_numbers, string notes)
    {
        SqlConnection SQLconnection = new SqlConnection(connectionString);
        SqlCommand command = SQLconnection.CreateCommand();
        SQLconnection.Open();
        command.CommandText = "UPDATE  students SET " +
        "first_name = " + "'" + first_name + "'" + " , last_name = " + "'" + last_name + "'" +
         " , father_name = " + "'" + father_name + "'" + " , mother_name = " + 
        "'" + mother_name + "'" + ", birth_date = " + "'" + birth_date + "'" +
        " , education_level = " + "'" + education_level + "'"  +
        " , address = " + "'" + address + "'" + " , notes = " + "'" + notes + "'" +
        " WHERE student_id = " + id ;
        command.ExecuteNonQuery();
        SQLconnection.Close();

//is there a better and clear way better than these syntax ?

  • 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-05T22:55:09+00:00Added an answer on June 5, 2026 at 10:55 pm

    The best method would be to use Parameters. Like this:

    command.CommandText = @"UPDATE  students SET 
    first_name = @first_name, 
    last_name = @last_name,
    //... and so on...
    WHERE student_id = @id";
    command.Parameters.AddWithValue("@first_name", first_name);
    command.Parameters.AddWithValue("@last_name", last_name);
    //... and so no...
    command.Parameters.AddWithValue("@id", id);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do you use a single character PHP Wildcard to make a String Replacement?
So at first i was trying to use character at index, then convert it
I am building an MFC C++ application with Use Unicode Character Set selected in
If I'm using utf-8 encoding for a character set that would use the character
This is my c++ struct (Use Multi-Byte Character Set) typedef struct hookCONFIG { int
How do I use the % character literal in an NSString stringWithFormat ? I
I am trying to use getc(character) to take an element from a file and
I know you can't use the character, tried ` instead and that didn't work,
I'm looking for the right wildcard character to use with jquery.datepicker.parseDate() in the doc
I'm trying to make Python use a Fortran DLL (call by referance). When running

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.