Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i have this Query
strQuery = string.Format("INSERT INTO [User](UserName,Password,FullName) Values('{0}','{1}','{2}')", txtUserName.Text, txtPassword.Text, txtFullname.Text);

my problem is the field UserName doesnot accept arabic charachter when i insert arabic charachter to the field txtUserName it get saved in the db ??????

note; field Usernameis set as
[Username] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

any help will be great


Regards
Posted
Comments
Arindam Tewary 18-Jun-11 16:24pm    
Are you getting any error? If you get error please post that error description.
akoyoon 18-Jun-11 16:36pm    
i don't get any errors just when i try to insert Arabic character they get saved ?????

1 solution

hi,
In your query use "N" before your field value for example
INSERT INTO [User](UserName,Password,FullName) Values(N'{0}','{1}','{2}')", txtUserName.Text, txtPassword.Text, txtFullname.Text
see the discussion below
http://forums.asp.net/t/982003.aspx/1?How+insert+Arabic+urdu+characters+in+SQL+server[^]
 
Share this answer
 
Comments
akoyoon 18-Jun-11 16:58pm    
thanx so much for your help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900