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
[code language=”vb”]
Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;
Password=myPassword;
[/code]
MySQL Connector/NET
[code language=”vb”]
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
[/code]
Microsoft Acess Connection (with database password)
[code language=”vb”]
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccessFile.accdb;
Jet OLEDB:Database Password=MyDbPassword;
[/code]
Microsoft XLSX Files
[code language=”vb”]
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myExcel2007file.xlsx;
Extended Properties="Excel 12.0 Xml;HDR=YES";
[/code]
Active Directory Provider
[code language=”vb”]
Provider=ADSDSOObject;User Id=myUsername;Password=myPassword;
[/code]
Query HTML Table
[code language=”vb”]
Provider=Microsoft.Jet.OLEDB.4.0; Data Source=http://www.websitewithhtmltable.com/tablepage.html;
Extended Properties="HTML Import;HDR=YES;IMEX=1";
[/code]
Oracle without tnsnames.ora
[code language=”vb”]
SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));
uid=myUsername;pwd=myPassword;
[/code]
Looking for quality web hosting? Look no further than Arvixe Web Hosting!