Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,176 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,952 people online right now. Registration is fast and FREE... Join Now!




inserting

 
Reply to this topicStart new topic

inserting

siddique.p
31 Dec, 2007 - 10:32 PM
Post #1

New D.I.C Head
*

Joined: 31 Dec, 2007
Posts: 1

I am inserting path of a image to mysql database.But in database I don't get the symbol \ in file path.I used fileupdoad do load the image. I am giving my code below.

string str1 = Server.MapPath("~/proimage/");
FileUploadimage.PostedFile.SaveAs(str1 + FileUploadimage.FileName);

string str2 = Server.MapPath("~/proimage/") + FileUploadimage.FileName;

//string str3="@"+str2;
//TextBoxtest.Text = str2;
//TextBoxtest2.Text = str3;
p.Setvalues(Convert.ToInt32(TextBoxmlsid.Text), DropDownList1forsale.SelectedItem.ToString(), DropDownList11forlease.SelectedItem.ToString(), TextBoxpropertytype.Text, TextBoxstate.Text, TextBoxcity.Text, Convert.ToSingle(TextBoxaskingprice.Text), Convert.ToSingle(TextBoxtaxes.Text), Convert.ToInt32(DropDownListbedroom.SelectedItem.ToString()), Convert.ToInt32(DropDownListbathroom.SelectedItem.ToString()), TextBoxarea.Text, str2);
d.SetValues(Convert.ToInt32(TextBoxmlsid.Text), TextBoxaddnumber.Text, DropDownListadddirection.SelectedItem.ToString(), TextBoxaddstreet.Text, DropDownListstyle.SelectedItem.ToString(), DropDownListpool.SelectedItem.ToString(), TextBoxyearbuilt.Text, Convert.ToInt32(TextBoxagentcode1.Text), TextBoxgarage.Text);

This post has been edited by siddique.p: 31 Dec, 2007 - 10:35 PM
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Inserting
31 Dec, 2007 - 11:43 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,199



Thanked: 213 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Sounds like you are not escaping the backslash character. Remember you can use \\ to insert a backslash. Notice how there are double blackslashes. The first backslash is the escape sequence for the second backslash. If you don't double backslash, it will think that the single backslash and the character following it is part of an escape sequence and will either fail or just not show the backslash.

See if that is your problem or not. smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 12:53AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month