开发者

problem inserting path into mysql database in vb.net

i have a problem in inserting the listbox value into mysql database in vb 2008 i.e

if i select a video file i.e D:\videos\video1.mpg and add a msgbox() event before inserting into data base it shows the exact path i.e D:\videos\video1.mp开发者_开发知识库g but when i check my database it shows me as D:videosvideo1.mpg how can i solve that


Within MySQL string values the backslash is interpreted as an escape character. The following escape sequences have special meaning to MySQL: \0, \', \", \b, \n, \r, \t, \z, \, \%, \_. Any other character preceeded by a backslash is just replaced with that character. So in your example: \v is not a valid escape sequence so it is replaced with just "v" when it is stored. You should alter your path values to contain the "\" sequence to actually store a backslash. Example: D:\\videos\\video1.mpg


try to insert path with two backslash signs, for example "D:\\videos\\video1.mpg" into database.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜