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. Windows Forms
  4. database problem

database problem

Scheduled Pinned Locked Moved Windows Forms
sysadmincsharpdatabasehelp
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.
  • N Offline
    N Offline
    Naresh123456789
    wrote on last edited by
    #1

    hi all i have faced one problem in my windows application(c#,ms access).i am using backend as ms access.i have written code like this. string s="datasource=C:\\cms\\cmsaccess.mdb"; string q="select * from users"; OledbConnection con=new OledbConnection(s); OledbDataAdapter adp=new OledbDataAdapter(q,con); DataSet ds=new DataSet(); adp.fill(ds,"users"); i have written like this in every form where ever i connected to database.but if i installed in server how the application access that database(C:\\cms\\cmsaccess.mdb) in clients .the database location may be changed in clients.i am facing this problem. this application must be run in network.please send solution for this problem. thank you regards obalesu n

    C 1 Reply Last reply
    0
    • N Naresh123456789

      hi all i have faced one problem in my windows application(c#,ms access).i am using backend as ms access.i have written code like this. string s="datasource=C:\\cms\\cmsaccess.mdb"; string q="select * from users"; OledbConnection con=new OledbConnection(s); OledbDataAdapter adp=new OledbDataAdapter(q,con); DataSet ds=new DataSet(); adp.fill(ds,"users"); i have written like this in every form where ever i connected to database.but if i installed in server how the application access that database(C:\\cms\\cmsaccess.mdb) in clients .the database location may be changed in clients.i am facing this problem. this application must be run in network.please send solution for this problem. thank you regards obalesu n

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      obalesu wrote:

      i have written like this in every form where ever i connected to database

      Create a DAL - All database related code should go in one location. That location is called a DAL.

      obalesu wrote:

      if i installed in server how the application access that database(C:\\cms\\cmsaccess.mdb) in clients .the database location may be changed in clients.i am facing this problem. this application must be run in network.please send solution for this problem.

      Have you thought about using config files?

      Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Different ways to add point data in SQL Server 2008 * Spatial References in SQL Server 2008 My website |

      N 1 Reply Last reply
      0
      • C Colin Angus Mackay

        obalesu wrote:

        i have written like this in every form where ever i connected to database

        Create a DAL - All database related code should go in one location. That location is called a DAL.

        obalesu wrote:

        if i installed in server how the application access that database(C:\\cms\\cmsaccess.mdb) in clients .the database location may be changed in clients.i am facing this problem. this application must be run in network.please send solution for this problem.

        Have you thought about using config files?

        Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Different ways to add point data in SQL Server 2008 * Spatial References in SQL Server 2008 My website |

        N Offline
        N Offline
        Naresh123456789
        wrote on last edited by
        #3

        thanks for reply, sir i don't have idea about config files please send clearly.i did not yet solve this problem.please send solution for this problem.and i can i use my application in network system. regards obalesu

        C 1 Reply Last reply
        0
        • N Naresh123456789

          thanks for reply, sir i don't have idea about config files please send clearly.i did not yet solve this problem.please send solution for this problem.and i can i use my application in network system. regards obalesu

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          obalesu wrote:

          sir i don't have idea about config files please send clearly

          Then you should be reading through a beginners book on the .NET Framework. It will explain much more clearly that I could do in the space of a forum post.

          obalesu wrote:

          please send solution for this problem.and i can i use my application in network system.

          I can only send suggestions for such a problem. It is up to you to find the solution. I am not paid to do your work. You are employed as a software developer, I would have said it was a prerequisit to know the basics around the technology in which you are developing. So, I repeat my advise to read a beginners book on the subject. I also don't know anything about your application. To suggest that I could send you some random piece of code that happens to work with your existing system betrays the depth of your lack of knowledge. Once you have read that beginners book you might be able to solve your problem yourself, or if not, you will have a better understanding of what the problem actually is.

          Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Mixins in C#3.0 My website | Blog

          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