Using Specific ConnectStrings in Applications

If you have built any application you know that a large part of an application is saving and retrieving data from some sort of storage. This storage comes in a multitude of types. It can be Microsofts’s Excel, SQL, Oracle, MySQL, oData, Exchange, etc. And although the general syntax is similar they each have their specific values.

I have provided a list of some common ways to connect to different data. If you can’t find it in this list then head on over to www.Connectionstrings.com and find more examples.

Connection to a SQL Server Instance

Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;
Password=myPassword;

MySQL Connector/NET

Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

Microsoft Acess Connection (with database password)

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccessFile.accdb;
Jet OLEDB:Database Password=MyDbPassword;

Microsoft XLSX Files

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myExcel2007file.xlsx;
Extended Properties="Excel 12.0 Xml;HDR=YES";

Active Directory Provider

Provider=ADSDSOObject;User Id=myUsername;Password=myPassword;

Query HTML Table

Provider=Microsoft.Jet.OLEDB.4.0; Data Source=http://www.websitewithhtmltable.com/tablepage.html;
Extended Properties="HTML Import;HDR=YES;IMEX=1";

Oracle without tnsnames.ora

SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));
uid=myUsername;pwd=myPassword;

Looking for quality web hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , , , , , | Posted under ASP .NET 4.0, Programming/Coding | RSS 2.0

Author Spotlight

David Bauernschmidt

David Bauernschmidt

I live in the historical triangle of Virginia where I am married with two daughters. I have spent over 13 years working for a Fortune 500 company in the computer area. I started in VB 6.0 and by the time I ended my employment I was supervising a development team where we built many web applications. When my first daughter was born I wanted to spend more time with her so I left and became a programmer analyst for local government as well as launch my own company. Since then I have grown James River Webs into a profitable web design and application company helping small businesses create a big presence on the internet. As an employee I have created web application used by citizens and other companies. I enjoy fly fishing, and spending time with my family. I also enjoy learning new approaches and development tools when it comes to developing applications.

Leave a Reply

Your email address will not be published. Required fields are marked *


4 × 2 =

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>