|
-
Mar 31st, 2005, 01:41 PM
#1
Thread Starter
New Member
Simple Problem... ("Filename Dialog" to a "String" (for Database Storage))
Hey All;
Of all the problems to encounter, so far everything works great in my Program, my Take on VB.net Control Arrays, and everything else, but here's my problem.
I allow the user to Select an Image using an 'OpenFileDialog' (which I set the Form's Background with, no problem their). But to store it in my MySQL Database, I have to of course convert it to a STRING. But when I convert OpenFileDialog.Filename to a String, it removes special characters in the Path. See the Example of what it changes below:
Example Path (User Selects):
C:\Temp\BackGround.jpg
After I do (ex. strImage = OpenFileDialog.FileName), with or without the .ToString after Filename, it stores the following Value in the String.
C:TempBackGround.jpg (Removing the " \ " Characters)
Obviously when I load this back from the Database later to Load that Image at that Path, it dosn't find it cause it's no longer a Proper Windows path without the " \ ".
I've tried various common methods like doing a System.Convert.TOString(OpenFileDialog.FileName) etc., and they all leave the string without that character...
Anyone have ideas or know a Method I'm missing to Convert this so the Path is Preserved properly so that I can recall this from the MySQL (uses a VarChar, no prob their), and set the Background to the Path with the Path stored PROPERLY???
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|