Re: inserting Turkish chars into sql server
From: Sergei Shelukhin (raven_at_at_home.domonet.ru)
Date: 03/14/05
- Next message: Val Mazur \(MVP\): "Re: Inject timeout BUT it's success"
- Previous message: Sergei Shelukhin: "inserting Turkish chars into sql server"
- In reply to: Sergei Shelukhin: "inserting Turkish chars into sql server"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 14 Mar 2005 03:49:45 +0300
Sergei Shelukhin wrote:
Nevermind. Only needed to add N to the query, like (N'"+....
> Hi.
>
> Here's the problem.
> I have ASP.NET web app and SQL Server 2k database.
> In the app, there's this button handler.
>
> string sql = "INSERT INTO Word (Word,WTranslation,Comment)
> VALUES
> ('"+txWord.Text.Trim()+"','"+txTranslation.Text.Trim()+"','"+txComment.Text.Trim()+"')";
>
> SqlCommand cmd = new SqlCommand(sql,cn);
> cn.Open();
> cmd.ExecuteNonQuery();
> cn.Close();
> txComment.Text = cmd.CommandText;
>
> Last line is for testing purposes.
> txWord field contains Turkish characters (C with cedilla, g with breve
> etc).
> When I submit the form, I get the right output in the comment field,
> e.g. all the letters are with cedillas, breves etc. I don't know if they
> (symbols) will work with ngs, but here's the query example:
>
> INSERT INTO Word (Word,WTranslation,Comment) VALUES ('çĞ','hhh','')
>
> Problem is that in SQL Servr database, symbols lose all their fancy
> stuff and come out as standart c-s, g-s etc.
>
> Default collation for the db is cyrillic, Word column collation is set
> to Turkish but it doesn't help.
> The same results are produced when I run the query from the query analyzer.
> How do I fix this?
- Next message: Val Mazur \(MVP\): "Re: Inject timeout BUT it's success"
- Previous message: Sergei Shelukhin: "inserting Turkish chars into sql server"
- In reply to: Sergei Shelukhin: "inserting Turkish chars into sql server"
- Messages sorted by: [ date ] [ thread ]