And here is the list of connection strings. (dataConfiguration.config file)
for Excel , Access, and TextFile:
<instances>
<instance name="pubsAccessInstance" type="OleDB"
connectionString="pubsAccessConnectionString" />
<instance name="pubsExcelInstance" type="OleDB"
connectionString="pubsExcelConnectionString" />
<instance name="textFileInstance" type="OleDB"
connectionString="textFileConnectionString" />
</instances>
<connectionStrings>
<connectionString name="pubsAccessConnectionString">
<parameters>
<parameter name="Provider" value="Microsoft.Jet.OLEDB.4.0"
isSensitive="false" />
<parameter name="Data Source"
value="c:\AccessDatabaseCopy\pubs2000.mdb" isSensitive="true" />
</parameters>
</connectionString>
<connectionString name="pubsExcelConnectionString">
<parameters>
<parameter name="Provider" value="Microsoft.Jet.OLEDB.4.0"
isSensitive="false" />
<parameter name="Data Source" value="C:\ExcelPubsCopy\pubs.xls"
isSensitive="false" />
<parameter name="Extended Properties" value="'Excel
8.0;HDR=Yes;IMEX=1'" isSensitive="false" />
</parameters>
</connectionString>
<connectionString name="textFileConnectionString">
<parameters>
<parameter name="Provider" value="Microsoft.Jet.OLEDB.4.0"
isSensitive="false" />
<!--
Notice the Data Source of a textfile is the DIRECTORY, not the full
path/filename
The Select statement looks like:
"Select * from mytextfile.txt"
-->
<!--
<parameter name="Data Source"
value="C:\Inetpub\wwwroot\DotNetAssemblies\Granada Coder\Applications\BulkDat
aTransferExample\TextFilePubsEquiv\" isSensitive="false" />
-->
<parameter name="Data Source" value="..\..\TextFilePubsEquiv\"
isSensitive="false" />
<parameter name="Extended Properties"
value="'text;HDR=YES;FMT=Delimited'" isSensitive="false" />
</parameters>
</connectionString>
</connectionStrings>
"SAL" <SA*@discussions.microsoft.comwrote in message
news:87**********************************@microsof t.com...
Thanks. It does work in Visual Studio 2003 just fine.
For those interested in this, here's some additional important info from
the
original author:
(http://www.geekswithblogs.net/cbreis.../03/38945.aspx)
Also, to make it work with Visual Studio 2003:
1. Create a new folder called OLEDB in C:\Program Files\Microsoft
Enterprise Library June 2005\src\Data\
2. Extract the contents from the download at gotdotnet link
3. Find the folder called Tests, and copy the entire Tests folder to the
OLEDB folder you created
4. Do the same for the files called OleDbCommandWrapper.cs & and
OleDbDatabase.cs
Just include it with you Data project so the next time you add the Data
project to your project you will have it.
Thanks again sloan.
"sloan" wrote:
This is the 1.1 solution, but will get you down the right path.
//OLEDB
http://www.gotdotnet.com/Community/U...1-3781DF71DCDD
Adding it to the project was easier..since there are some private
methods
need to be made public to have it outside the assembly.
"SAL" <SA*@discussions.microsoft.comwrote in message
news:05**********************************@microsof t.com...
Hi,
>
I have Microsoft Enterprise Library 2005 installed on my local system.
I'm
developing in C# using Visual Studio 2003 IDE with framework 1.1.
>
I am automating a process that will use a DLL assembly I am
developing. I
am going to use the data Access Application Block for data access in
my
DLL
assembly, and a Windows Service will execute the DLL on a set
schedule.
To
make this happen I will add the Common, Configuration, and Data
projects
to
my DLL assembly project.
>
My question is, how would I handle the SQL Server and Jet OLEDB
database
Instances? The reason for Jet OLEDB, is my process will open an Excel
spreadsheet, read the data, then insert that data into a SQL Server
database
table. However, I am fairly new to the Microsoft Enterprise Library
2005,
and it appears that Microsoft only provided SQL Server and Oracle
access
with
this reusable code.
>
Just an FYI, I keep my question short for simplicity, but there is
more
going on in my DLL assembly that pushing data to SQL Server otherwise
I
would
have used DTS.
>
Thanks,
>
>