473,396 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Data Access Application Block with C#

SAL
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,
Sep 11 '06 #1
3 2893
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,


Sep 11 '06 #2
SAL
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,


Sep 11 '06 #3

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,
>
>

Sep 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Özgür Aytekin | last post by:
Hello NG Is DAAB 3.1 the offical replacement of Microsoft Data Access Application Block 2.0? DAAB 3.1 download:...
4
by: ad | last post by:
I want to develop DataBase application. How about Data Access Application Block? Is it useful?
0
by: ad | last post by:
I have used Data Application Access Block2 in my web application. Now I download the Library Data Access Application Block. and read the document. May be I am stupid, I can't migrate it to...
2
by: headware | last post by:
I'm relatively new to ASP.NET and ADO.NET, but I have a basic design question regarding the use of web services and APS.NET applications. Right now we have an application that uses web services to...
1
by: EO | last post by:
I am trying to use the MSFT data access application block on 3 machines. Machine 1: Sandbox environment; I installed the application block with the msi. The Sqlhelper class compiles & runs...
3
by: Rachel | last post by:
Hi, I am using the data access application block successfully in our development environment, however when I deploy to our testing server as Private Assemblies I keep getting the following ...
6
by: Jonathan Crawford | last post by:
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473 Hi I have installed the enterprise library on a development machine and created a project on our webserver. When...
2
by: Tim::.. | last post by:
Can someone tell me how you change this code for an Oledb connection rather than SQL Server. The code currently uses Microsoft.Data.Access.Application.Block and the SQLHelper object... I need to...
6
by: Mukesh | last post by:
Hi I have Microsoft Enterprise Library 2005 installed on my local system. I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql Server 2000. I am developing a web application...
3
by: Mukesh | last post by:
Hi all As per my earlier conversation with Ciaran (thx for reply) I have installed the MS APplication block on the server , when i ran Build Enterprise Library file and Install Services from...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.