Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. problem with DataBase Path While uploading Images

problem with DataBase Path While uploading Images

Scheduled Pinned Locked Moved C#
helpquestioncsharpdatabase
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    avvaru murali
    wrote on last edited by
    #1

    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; 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... please reply where the problem is ? how can i rectify this .

    murali krishna

    S 1 Reply Last reply
    0
    • A avvaru murali

      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; 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... please reply where the problem is ? how can i rectify this .

      murali krishna

      S Offline
      S Offline
      Spunky Coder
      wrote on last edited by
      #2

      I think u are setting the image path in dsRelativePath after the image is selected...check that ...if so store the path in different variable

      .....

      A 1 Reply Last reply
      0
      • S Spunky Coder

        I think u are setting the image path in dsRelativePath after the image is selected...check that ...if so store the path in different variable

        .....

        A Offline
        A Offline
        avvaru murali
        wrote on last edited by
        #3

        Hi, Thanks for Reply.. Here iam not setting ImagePath to "dsAbsolutePath"; iam taking Imagepath to another string.

        murali krishna

        S 1 Reply Last reply
        0
        • A avvaru murali

          Hi, Thanks for Reply.. Here iam not setting ImagePath to "dsAbsolutePath"; iam taking Imagepath to another string.

          murali krishna

          S Offline
          S Offline
          Spunky Coder
          wrote on last edited by
          #4

          i don't understand how come image path value is taken in dsAbsolutePath without setting it ...declare the dsAbsolutePath and dsRelativePath variables as constants and see if the error still occurs..can u post your code ?

          .....

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups