473,804 Members | 3,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2912
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*@discussion s.microsoft.com wrote in message
news:05******** *************** ***********@mic rosoft.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 OleDbCommandWra pper.cs & and
OleDbDatabase.c s

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*@discussion s.microsoft.com wrote in message
news:05******** *************** ***********@mic rosoft.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. (dataConfigurat ion.config file)
for Excel , Access, and TextFile:

<instances>
<instance name="pubsAcces sInstance" type="OleDB"
connectionStrin g="pubsAccessCo nnectionString" />

<instance name="pubsExcel Instance" type="OleDB"
connectionStrin g="pubsExcelCon nectionString" />

<instance name="textFileI nstance" type="OleDB"
connectionStrin g="textFileConn ectionString" />
</instances>
<connectionStri ngs>

<connectionStri ng name="pubsAcces sConnectionStri ng">
<parameters>
<parameter name="Provider" value="Microsof t.Jet.OLEDB.4.0 "
isSensitive="fa lse" />
<parameter name="Data Source"
value="c:\Acces sDatabaseCopy\p ubs2000.mdb" isSensitive="tr ue" />
</parameters>
</connectionStrin g>

<connectionStri ng name="pubsExcel ConnectionStrin g">
<parameters>
<parameter name="Provider" value="Microsof t.Jet.OLEDB.4.0 "
isSensitive="fa lse" />
<parameter name="Data Source" value="C:\Excel PubsCopy\pubs.x ls"
isSensitive="fa lse" />
<parameter name="Extended Properties" value="'Excel
8.0;HDR=Yes;IME X=1'" isSensitive="fa lse" />
</parameters>
</connectionStrin g>

<connectionStri ng name="textFileC onnectionString ">
<parameters>
<parameter name="Provider" value="Microsof t.Jet.OLEDB.4.0 "
isSensitive="fa lse" />
<!--
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:\Inetp ub\wwwroot\DotN etAssemblies\Gr anadaCoder\Appl ications\BulkDa t
aTransferExampl e\TextFilePubsE quiv\" isSensitive="fa lse" />
-->
<parameter name="Data Source" value="..\..\Te xtFilePubsEquiv \"
isSensitive="fa lse" />
<parameter name="Extended Properties"
value="'text;HD R=YES;FMT=Delim ited'" isSensitive="fa lse" />
</parameters>
</connectionStrin g>

</connectionStrin gs>


"SAL" <SA*@discussion s.microsoft.com wrote in message
news:87******** *************** ***********@mic rosoft.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 OleDbCommandWra pper.cs & and
OleDbDatabase.c s

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*@discussion s.microsoft.com wrote in message
news:05******** *************** ***********@mic rosoft.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
1849
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: http://www.gotdotnet.com/Community/Workspaces/viewuploads.aspx?id=c20d12b0-af52-402b-9b7c-aaeb21d1f431 We'll use for our online stock exchange game (www.borsagame.com) a data access application block with source code. But, we are not sure, which one is better. DAAB 3.1 or MS Data Access Application Block 2.0?
4
1909
by: ad | last post by:
I want to develop DataBase application. How about Data Access Application Block? Is it useful?
0
2230
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 Enterprise Library Data Access Application Block. The code below is the Data Application Access Block 2, How can I modified them? //---------------using Data Application Access Block
2
2215
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 access the database layer. However, the code works in a pretty cumbersome and ungeneric way. Basically every query, update, and insert has its own function. So you see a lot of functions like webService.InsertCustomer(name, age, phone); or...
1
1932
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 great! (Also the SqlhelperParameterCache class; I'll refer to them collectively as the SqlHelper class.) I'm using unmodified application block code in all cases. Machine 2: Development environment, different project
3
1731
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 Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
6
1952
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 I run a simple data access page I get an error message. Apparently
2
2517
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 use this with an access database! reader = SqlHelper.ExecuteReader(ConfigurationSettings.AppSettings("strConn"), CommandType.StoredProcedure, "rolesForUser", New OleDbParameter("@Username", User.Identity.Name))
6
4154
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 in which i am using data Access Application Block for data access. I have a remote web n data server with asp.net 1.1 support
3
1820
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 (batch files ) programme files menu it was asking for visual studio 2003 , I have only .net framework on the server how can i use the MS application block data access library on my server plz help... Mukesh Agarwal
0
9710
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9589
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10593
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10329
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9163
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3000
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.