problem with DataBase path when uploading image
-
Hi iam in windows application using c#. my database is "FireBird Database". Database path is : string dsRelativePath = "database\\absolutemedia.fdb"; string dsAbsolutePath = Path.GetFullPath(dsRelativePath); string ConnectionString = "ServerType=1;User=SYSDBA;Password=masterkey;Database=" +dsAbsolutePath; //Code for upload image OpenFileDialog opn = new OpenFileDialog(); opn.Filter = "JPEG|*.jpg|GIF|*.gif"; opn.ShowDialog(); if (opn.FileName.Length > 0) { this.IMG = Image.FromFile(opn.FileName); browsetext.Text = opn.FileName; this.resizeHeight = 240; this.resizeWidth = 320; IMG = this.resizeImage(IMG, new Size(resizeWidth, resizeHeight)); imagebox.Image = IMG; } This path is working fine upto now.. but in my application, i have an option to upload images from local drives..iam browisng an image thru "OpenFileDialog".. after selecting an image .when iam going to save , database path i,e dsAbsolutePath is changed to image path.it's giving error in database connection... Error---"I/O error for file CreateFile (open) "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\database\absolutemedia.fdb" please reply where the problem is ? how can i rectify this .
murali krishna