\r\n\r\n
Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET Database and Reporting > Problem with the é character on insert command


\r\n \r\n
 
 
Thread Tools Display Modes

\r\n\r\n\r\n
I am having a problem inserting a certain record into an sql database. Basically the database is a table that is used to keep track of tv shows on my hard drive. The table carries the filename of the episode, description, season and episode numbers, etc.
\r\n
\r\nHere is the filename of the episode:
\r\nEpisode 13 - Beef Consommé.mp4
\r\n
\r\nAs you can see, the letter é is in there. So I used the following code:
\r\n
\r\n
\r\n
Code:
\r\n
\'Add the parameter for the TVShowFileName\r\nmyCommand.Parameters.Add("@TVShowFileName", SqlDbType.VarChar, 200).Value = TVShow.TVShowFileName.ToString\r\n\r\n\'Add the parameter for the Episode Description\r\n myCommand.Parameters.Add("@ShowEpisodeTitle", SqlDbType.VarChar, 200).Value = TVShow.ShowEpisodeTitle.ToString\r\n\r\n...\r\n\r\nmyCommand.ExecuteNonQuery
\r\n
The insert command executes successfully and the record is added, however the TVShowFileName for some reason get\'s changed
\r\n
\r\nfrom this:
\r\nE:\\Media Folders\\TV Shows\\Arrested Development\\Season 1\\Episode 13 - Beef Consommé.mp4
\r\n
\r\nto this:
\r\nE:\\Media Folders\\TV Shows\\Arrested Development\\Season 1\\Episode 13 - Beef Consomme\'.mp4
\r\n
\r\nAs you can see, the letter é is changed to e\'
\r\n
\r\nNow here is the funny part, the ShowEpisodeTitle remains unchanged:
\r\nBeef Consommé
\r\n
\r\nSo at first I thought that maybe non english characters weren\'t allowed and they were being changed, but if that is the case then the ShowEpisodeTitle should be changed also.
\r\n
\r\nThis is causing a problem for 2 reasons. The first reason is when the program loads, it compares all the files in my tv shows folder to the files listed in the database. It then adds any files that haven\'t been added to the database yet. So every time the program loads, this specific episode is added again. The second problem is, when my program goes to play this episode, the Windows Media Player control throws an error since it\'s not able to find the file. I just don\'t understand why only one column in the table is being changed but not the other. Both the ShowEpisodeTitle and TVShowFileName are configured exactly the same, varchar(200), with the exception that the TVShowFileName does not accept nulls (for obvious reasons).
\r\n
\r\nI am pretty well seasoned in SQL but i\'m sure someone else who knows more may know the answer.
\r\n \r\n\r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n'; pd[1347465] = '\r\n\r\n \r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n
\r\n
\r\n  \r\n #2  \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n Old\r\n \r\n 11-23-2009, 12:46 PM\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n therealtomlapp\r\n therealtomlapp is offline\r\n\r\n\r\n
Prev Previous Post   Next Post Next
  #1  
Old 11-23-2009, 11:58 AM
therealtomlapp therealtomlapp is offline
Freshman
 
Join Date: Jan 2009
Location: New Jersey
Posts: 40
Default Problem with the é character on insert command


I am having a problem inserting a certain record into an sql database. Basically the database is a table that is used to keep track of tv shows on my hard drive. The table carries the filename of the episode, description, season and episode numbers, etc.

Here is the filename of the episode:
Episode 13 - Beef Consommé.mp4

As you can see, the letter é is in there. So I used the following code:

Code:
'Add the parameter for the TVShowFileName
myCommand.Parameters.Add("@TVShowFileName", SqlDbType.VarChar, 200).Value = TVShow.TVShowFileName.ToString

'Add the parameter for the Episode Description
 myCommand.Parameters.Add("@ShowEpisodeTitle", SqlDbType.VarChar, 200).Value = TVShow.ShowEpisodeTitle.ToString

...

myCommand.ExecuteNonQuery
The insert command executes successfully and the record is added, however the TVShowFileName for some reason get's changed

from this:
E:\Media Folders\TV Shows\Arrested Development\Season 1\Episode 13 - Beef Consommé.mp4

to this:
E:\Media Folders\TV Shows\Arrested Development\Season 1\Episode 13 - Beef Consomme'.mp4

As you can see, the letter é is changed to e'

Now here is the funny part, the ShowEpisodeTitle remains unchanged:
Beef Consommé

So at first I thought that maybe non english characters weren't allowed and they were being changed, but if that is the case then the ShowEpisodeTitle should be changed also.

This is causing a problem for 2 reasons. The first reason is when the program loads, it compares all the files in my tv shows folder to the files listed in the database. It then adds any files that haven't been added to the database yet. So every time the program loads, this specific episode is added again. The second problem is, when my program goes to play this episode, the Windows Media Player control throws an error since it's not able to find the file. I just don't understand why only one column in the table is being changed but not the other. Both the ShowEpisodeTitle and TVShowFileName are configured exactly the same, varchar(200), with the exception that the TVShowFileName does not accept nulls (for obvious reasons).

I am pretty well seasoned in SQL but i'm sure someone else who knows more may know the answer.
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->