I am developing a windows application in which the input is in marathi language. I have the code to insert data in sql server.
But now my problem is that I am trying to do same from my window application. I wrote the following code.
create database Test
create table marathi(Names nvarchar(22)) insert marathi SELECT N'???????' ---- Right Query
insert marathi SELECT '???????' ---- Wrong Query
select *from marathijust check once the above query in sql, you will understand it. If u write the query using N prefix then in sql it shows the data properly, but if don't use N prefix then it shows ??????? in sql server.
But now my problem is that I am trying to do same from my window application. I wrote the following code.
SqlCommand slc = con.CreateCommand();
slc.CommandText = "Insert into marathi values(@Names)"
slc.Parameters.Add("@Names", SqlDbType.NVarChar, 22);
slc.Parameters["@Names"].Value = textBox1.Text;
slc.ExecuteNonQuery();How can I achieve this? Please Help....
Afzaal Ahmad ZeeshanPosted Mar 15, 2015, 12:10 PM
A similar article was written by me, which covers SQL Server databases too. You can read that article here. Hopefully that article would clarify the basic concept of Unicode character encodings in .NET framework.