Can't insert special characters to SQL

Please support our MS SQL advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Oct 2008
Posts: 56
Reputation: konczuras is an unknown quantity at this point 
Solved Threads: 1
konczuras konczuras is offline Offline
Junior Poster in Training

Can't insert special characters to SQL

 
0
  #1
Nov 3rd, 2008
Hi Everyone!

I have to make a forum with MS SQL, and, as I'm Hungarian, we use characters, like áéíőúű, etc. Now, if I insert a text with the letter ő or ű, I get back o and u. How can I solve this problem?

The users write posts in an aspx website, by a textbox. I use this code in the insertcommand:
  1. @"INSERT INTO Forum2 (Sorszám, Idő, Feladó, Üzenet) VALUES (" + GridView1.Rows.Count + ", '" + DATETIME.NOW + "', '" + namebox.TEXT.ToString() + "', '" + @message.TEXT.ToString() + "')";

Oh, and is there any way to count an SQL database's rows? That way, I could allow paging..

Thank you!
Last edited by peter_budo; Nov 5th, 2008 at 9:25 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Can't insert special characters to SQL

 
0
  #2
Nov 3rd, 2008
row count is easy, just use
  1. SELECT count(*) FROM TABLE

what is the character set of the db?
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 5
Reputation: canonzone is an unknown quantity at this point 
Solved Threads: 1
canonzone canonzone is offline Offline
Newbie Poster

Re: Can't insert special characters to SQL

 
0
  #3
Nov 6th, 2008
1,You must set the table field which use unicode characters with nvarchar type.

2,In dot net program environment , save the page as utf-8.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC