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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Issue with DatabaseFactory.CreateDatabase

Issue with DatabaseFactory.CreateDatabase

Scheduled Pinned Locked Moved .NET (Core and Framework)
databasehelpquestion
2 Posts 2 Posters 1 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.
  • V Offline
    V Offline
    venkaa
    wrote on last edited by
    #1

    Hello friends, I have the following piece of code to call a stored procedure in SQL database: Database db = DatabaseFactory.CreateDatabase(_DatabaseInstanceName); DBCommandWrapper cmdWrapper = db.GetStoredProcCommandWrapper(spName); cmdWrapper.AddInParameter("c_WksID", DbType.Int32, c_WksID); .... In line 1 where I call the DatabaseFactory, I am not getting a good connection string to my database. If I interrogate db, in the watch window, I see that Connection String has an "error: Cannot obtain value" against it. I have lot of stored procedures wrapper in my code and everything works except this. Can someone please please help me? Thanks. -arvind

    M 1 Reply Last reply
    0
    • V venkaa

      Hello friends, I have the following piece of code to call a stored procedure in SQL database: Database db = DatabaseFactory.CreateDatabase(_DatabaseInstanceName); DBCommandWrapper cmdWrapper = db.GetStoredProcCommandWrapper(spName); cmdWrapper.AddInParameter("c_WksID", DbType.Int32, c_WksID); .... In line 1 where I call the DatabaseFactory, I am not getting a good connection string to my database. If I interrogate db, in the watch window, I see that Connection String has an "error: Cannot obtain value" against it. I have lot of stored procedures wrapper in my code and everything works except this. Can someone please please help me? Thanks. -arvind

      M Offline
      M Offline
      Mr Brown Shoes
      wrote on last edited by
      #2

      Does the line DatabaseFactory.CreateDatabase(_DatabaseInstanceName) work elsewhere in your code? If not, is the connection string set up properly in your config file? If so, is your code able to access the config file?

      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