-
June 9th, 2015, 03:21 AM
#1
App to DB
I know this question may have been asked before, but let me ask this one more time...
what are some ways in which an App can be linked to a DB?
The first answer i will get is via connection strings.
http://www.connectionstrings.com/
But i would like to know how else can it be possible to link an app [that would be used on a LAN/WAN] to a DB that is dynamically stored on a LAN/WAN (NOT online/cloud)
--------------------------------------------------
Please pardon me for having bad English.
-
June 9th, 2015, 06:22 AM
#2
Re: App to DB
What prevents you to use connection strings?
Victor Nijegorodov
-
June 9th, 2015, 01:48 PM
#3
Re: App to DB
Connection strings are simply a way to direct a database provider to where your database is located.
As far as database providers, there are many different types such as ADO.Net and Entity Framework to name a few.
Connection strings are going to do anything on their own - they need to be used with a data provider.
-
June 10th, 2015, 04:55 AM
#4
Re: App to DB
Originally Posted by VictorN
What prevents you to use connection strings?
nothing is preventing me from using connection strings. I am just trying to broaden my knowledge thats all.
Arjay, i mostly work with MS applications. and for my very first small project i am using MS Access 2010 to be exact and Visual C# 2012 Express
--------------------------------------------------
Please pardon me for having bad English.
-
June 10th, 2015, 04:26 PM
#5
Re: App to DB
Originally Posted by rockx
nothing is preventing me from using connection strings. I am just trying to broaden my knowledge thats all.
Arjay, i mostly work with MS applications. and for my very first small project i am using MS Access 2010 to be exact and Visual C# 2012 Express
Just to be clear, connection strings don't do anything on their own - you need a database provider to use them with and need to use a provider that allows you to connect with your data.
For MS Access, you can use the OleDbConnection provider.
Code:
var connStr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data source= C:\Documents and Settings\username\My Documents\AccessFile.mdb";
using(var conn = new OleDbConnection(connStr))
{
try
{
conn.Open();
using(var cmd = new OleDbCommand(conn))
{
// Insert code to process data
}
}
catch (Exception ex)
{
// handle error
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|