VB
Public Shared Function GetConnectionString() As String
Return ConfigurationManager.ConnectionStrings("ConnectionString").ToString()
' access properties
' if access driver is NOT installed on machine - most possible
Return "Driver={Microsoft Access Driver (*.mdb, *.accdb)};
DBQ=C:\Projects\MyProject\DataSource\ProjectDB.accdb"
' if access driver is installed on machine
Return "DSN=CrescoOelweinMerger;
DBQ=C:\Projects\MyProject\DataSource\ProjectDB.accdb"
End Function
C#
public static string GetConnectionString()
{
return ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
}