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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:55:02+00:00 2026-05-26T07:55:02+00:00

I want to send some unicode strings (for example ش) to my SQL DataBase

  • 0

I want to send some unicode strings (for example “ش”) to my SQL DataBase stored procedure.
and my code is :

SqlConnection connection = new SqlConnection("Data Source=(local);Initial Catalog=Khane;Integrated Security=True");

SqlCommand command = new SqlCommand();
command.Connection = connection;
command.CommandType = CommandType.Text; 



command.CommandText = s;
connection.Open();



SqlDataReader reader = command.ExecuteReader();

while (reader.Read())
{
Common.CommonPersonSerchResult res = new Common.CommonPersonSerchResult();

res.ID = (int)reader.GetValue(0);
res.FirstName = reader.GetValue(1).ToString();
res.LastName = reader.GetValue(2).ToString();
res.FatherName = reader.GetValue(3).ToString();
res.NationalCode = (int)reader.GetValue(4);
res.ShenasnameCode = (int)reader.GetValue(5);
res.BirthDate = reader.GetValue(6).ToString();
res.State = reader.GetValue(7).ToString();
res.City = reader.GetValue(8).ToString();
res.PostalCode = (int)reader.GetValue(10);
res.SportType = reader.GetValue(11).ToString();
res.SportStyle = reader.GetValue(12).ToString();
res.RegisterType = reader.GetValue(13).ToString();
res.Ghahremani = reader.GetValue(14).ToString();

SerchResult.Add(res);

}

connection.Close();

But I can’t see any results but I know There is some rows can be show

this is my stored procedure:

USE [Khane]
GO
/****** Object:  StoredProcedure [dbo].[QuickSerch]    Script Date: 10/19/2011 18:31:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:      <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[QuickSerch] 
@item nvarchar(300)
AS
BEGIN    
select * from PersonsDataTbl 
where 
Name like '%@item%' or 
LastName like '%@item%' or
FatherName like '%@item%' or
NationalCode like '%@item%' or
ShenasnameCode like '%@item%' or
BirthDate like '%@item%' or
State like '%@item%' or
City like '%@item%' or
Address like '%@item%' or
PostalCode like '%@item%' or
SportType like '%@item%' or
SportStyle like '%@item%' or
RegisterType like '%@item%' or
Ghahremani like '%@item%' 
END
  • 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-26T07:55:03+00:00Added an answer on May 26, 2026 at 7:55 am

    Your stored procedure code should be:

    LIKE '%' + @item + '%'
    

    Otherwise you’re looking for values that contain the literal string “@item”.

    Also, be aware that your code isn’t likely to perform very well if you have a large number of rows in your table. Between the OR statements and the leading wildcards it won’t be able to make use of any indexes. You might want to look into fulltext searching.

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

Sidebar

Related Questions

I want to send some strings in a list in a POST call. eg:
I want send some data to a remote webpage from my site. Actually it
I want to send some data to a user after they log in to
I want to send some info back to my database when a user prints
I have a problem. i want to send some data to my iframe.php file..
I want to send some data to a server through POST method in android.
I want to send some Data with tha $.ajax() method from JQuery. The problem
I want to send some data to a root process with a named pipe.
I have a predicament: I want to send some data with an event listener
I have a web page which I want to send some JSON data down

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.