vb.net - Wrongly inserted values to MySQL table -
when executed query:
"insert search_option(filename, file_path, keywords)" & _ "values('csharp_tutorial.pdf','d:\pdf_record\csharp_tutorial.pdf','c sharp tutorial')"
the value inserted table. when select
value table
select * search_option s;
will give result as
filename | file_path | keywords | | csharp_tutorial.pdf | d:pdf_recordcsharp_tutorial.pdf | c sharp tutorial
the problem d:\pdf_record\csharp_tutorial.pdf
inserted d:pdf_recordcsharp_tutorial.pdf
why \
disappears...?
please suggest me solutions
the problem \
if want insert \
database need add \\
in code same in case of double quotes if want double quotes means need add \"
, other examples escape sequence available here
hence code be:
"insert search_option(filename, file_path, keywords)" & _ "values('csharp_tutorial.pdf','d:\\pdf_record\\csharp_tutorial.pdf','c sharp tutorial')"
if execute vb.net can use replace
method replace \
\\
filepath.replace("\", "\\")
Comments
Post a Comment