database problem
-
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
-
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
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 |
-
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 |
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
-
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
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