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