473,383 Members | 1,735 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,383 software developers and data experts.

Data Access using Enterprise Libraries

Joe
Hello All:

I am trying to use the Enterprise Libraries created by Microsoft to update a
DB2 database and am stuck. I need to be able to Insert, Update and Delete
records from the DB2 datbase tables. I can use the UpdateDataSet method to
do this, but I am not sure how to use it. I have Googled the method and
haven't relly found anything helpful. Here's one question:

The method takes several parameters, among them an insert command, update
command and delete command. How does the method know which command to
execute? Does anyone know of a good online example of this code?

Any help would be greatly appreciated.

Thanks,
--
Joe
Jun 13 '06 #1
7 1329
Which class/interface are you using?

Joe wrote:
Hello All:

I am trying to use the Enterprise Libraries created by Microsoft to update a
DB2 database and am stuck. I need to be able to Insert, Update and Delete
records from the DB2 datbase tables. I can use the UpdateDataSet method to
do this, but I am not sure how to use it. I have Googled the method and
haven't relly found anything helpful. Here's one question:

The method takes several parameters, among them an insert command, update
command and delete command. How does the method know which command to
execute? Does anyone know of a good online example of this code?

Any help would be greatly appreciated.

Thanks,

Jun 13 '06 #2
Joe
Thanks for responding; I appreciate it.

I'm using the following code to try to figure out what I'm doing. It is not
meant to be complete and certainly is not.
**********************************************
Public Shared Sub UpdateClaimForm(ByVal claimsFormData As DataTable)
Dim sqlQuery As New StringBuilder
sqlQuery.Append("INSERT SUP_CLAIM_FORMS")
sqlQuery.Append(" SET FORM_NUMBER = 'WB3',")
sqlQuery.Append(" FORM_NAME = 'My Form',")
sqlQuery.Append(" FORM_PATH_FILE_NM = 'WB3.xml',")
sqlQuery.Append(" FORM_STATE_CD = 'IL'")

' create an instance of the DB2Database class (Data Access
Enterprise Library) and DBCommandWrapper
Dim ClaimDatabase As DB2Database =
DirectCast(DatabaseFactory.CreateDatabase, DB2Database)
Dim UpdateClaimDataCmd As DBCommandWrapper =
ClaimDatabase.GetSqlStringCommandWrapper(sqlQuery. ToString)
Dim trans As IDbTransaction =
ClaimDatabase.GetConnection().BeginTransaction()

' update dataset
Dim ds As New DataSet
ds.Tables.Add(claimsFormData)
ClaimDatabase.UpdateDataSet(ds, claimsFormData.TableName, ???,
UpdateClaimDataCmd, ???, trans)

UpdateClaimDataCmd.Dispose()
End Sub
**********************************************

--
Joe
"mnichols" wrote:
Which class/interface are you using?

Joe wrote:
Hello All:

I am trying to use the Enterprise Libraries created by Microsoft to update a
DB2 database and am stuck. I need to be able to Insert, Update and Delete
records from the DB2 datbase tables. I can use the UpdateDataSet method to
do this, but I am not sure how to use it. I have Googled the method and
haven't relly found anything helpful. Here's one question:

The method takes several parameters, among them an insert command, update
command and delete command. How does the method know which command to
execute? Does anyone know of a good online example of this code?

Any help would be greatly appreciated.

Thanks,

Jun 13 '06 #3
Ah, this looks like an experimental/community project - sorry but I
can't help. I guess you have been here already:

http://www.gotdotnet.com/codegallery...2-91be63527327
http://msdn.microsoft.com/library/de.../html/daab.asp

mnichols
Joe wrote:
Thanks for responding; I appreciate it.

I'm using the following code to try to figure out what I'm doing. It is not
meant to be complete and certainly is not.
**********************************************
Public Shared Sub UpdateClaimForm(ByVal claimsFormData As DataTable)
Dim sqlQuery As New StringBuilder
sqlQuery.Append("INSERT SUP_CLAIM_FORMS")
sqlQuery.Append(" SET FORM_NUMBER = 'WB3',")
sqlQuery.Append(" FORM_NAME = 'My Form',")
sqlQuery.Append(" FORM_PATH_FILE_NM = 'WB3.xml',")
sqlQuery.Append(" FORM_STATE_CD = 'IL'")

' create an instance of the DB2Database class (Data Access
Enterprise Library) and DBCommandWrapper
Dim ClaimDatabase As DB2Database =
DirectCast(DatabaseFactory.CreateDatabase, DB2Database)
Dim UpdateClaimDataCmd As DBCommandWrapper =
ClaimDatabase.GetSqlStringCommandWrapper(sqlQuery. ToString)
Dim trans As IDbTransaction =
ClaimDatabase.GetConnection().BeginTransaction()

' update dataset
Dim ds As New DataSet
ds.Tables.Add(claimsFormData)
ClaimDatabase.UpdateDataSet(ds, claimsFormData.TableName, ???,
UpdateClaimDataCmd, ???, trans)

UpdateClaimDataCmd.Dispose()
End Sub
**********************************************

Jun 13 '06 #4
Joe
I don't know what you mean by an experimental/community project. I am an
ASP.NET developer for an insurance company in the Midwest. We use DB2
databases.

--
Joe
"mnichols" wrote:
Ah, this looks like an experimental/community project - sorry but I
can't help. I guess you have been here already:

http://www.gotdotnet.com/codegallery...2-91be63527327
http://msdn.microsoft.com/library/de.../html/daab.asp

mnichols
Joe wrote:
Thanks for responding; I appreciate it.

I'm using the following code to try to figure out what I'm doing. It is not
meant to be complete and certainly is not.
**********************************************
Public Shared Sub UpdateClaimForm(ByVal claimsFormData As DataTable)
Dim sqlQuery As New StringBuilder
sqlQuery.Append("INSERT SUP_CLAIM_FORMS")
sqlQuery.Append(" SET FORM_NUMBER = 'WB3',")
sqlQuery.Append(" FORM_NAME = 'My Form',")
sqlQuery.Append(" FORM_PATH_FILE_NM = 'WB3.xml',")
sqlQuery.Append(" FORM_STATE_CD = 'IL'")

' create an instance of the DB2Database class (Data Access
Enterprise Library) and DBCommandWrapper
Dim ClaimDatabase As DB2Database =
DirectCast(DatabaseFactory.CreateDatabase, DB2Database)
Dim UpdateClaimDataCmd As DBCommandWrapper =
ClaimDatabase.GetSqlStringCommandWrapper(sqlQuery. ToString)
Dim trans As IDbTransaction =
ClaimDatabase.GetConnection().BeginTransaction()

' update dataset
Dim ds As New DataSet
ds.Tables.Add(claimsFormData)
ClaimDatabase.UpdateDataSet(ds, claimsFormData.TableName, ???,
UpdateClaimDataCmd, ???, trans)

UpdateClaimDataCmd.Dispose()
End Sub
**********************************************

Jun 13 '06 #5
I mean the libraries are not a core part of ASP.NET.

They appear to be a community project from gotdotnet and the docs have
not been written yet. Nothing wrong with that except that I have no
experience with the project.

best of luck.

mnichols

Joe wrote:
I don't know what you mean by an experimental/community project. I am an
ASP.NET developer for an insurance company in the Midwest. We use DB2
databases.

Jun 13 '06 #6
Joe
Thanks. Appreciate your posts.
--
Joe
"mnichols" wrote:
I mean the libraries are not a core part of ASP.NET.

They appear to be a community project from gotdotnet and the docs have
not been written yet. Nothing wrong with that except that I have no
experience with the project.

best of luck.

mnichols

Joe wrote:
I don't know what you mean by an experimental/community project. I am an
ASP.NET developer for an insurance company in the Midwest. We use DB2
databases.

Jun 13 '06 #7
Thus wrote Joe,
Hello All:

I am trying to use the Enterprise Libraries created by Microsoft to
update a DB2 database and am stuck. I need to be able to Insert,
Update and Delete records from the DB2 datbase tables. I can use the
UpdateDataSet method to do this, but I am not sure how to use it. I
have Googled the method and haven't relly found anything helpful.
Here's one question:

The method takes several parameters, among them an insert command,
update command and delete command. How does the method know which
command to execute? Does anyone know of a good online example of this
code?


The idea is that for each added row, insertCommand is called, for each updated
row updateCommand is called, and for each deleted row deleteCommand is called.
The DataSet keeps track of all these changes. This behavior is restricted
to one table in the DataSet, therefore you have to pass the table name as
well.

See "Walkthrough: Using a DataSet to Update a Database" in EL's help file
for more details.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Jun 13 '06 #8

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

Similar topics

0
by: keyway | last post by:
We have recently implemented (enterprise library) data application blocks to VB.NET console applications - very nice. The console apps read an app.config file, which in turn communicates w/ a...
4
by: BerkshireGuy | last post by:
Our IT department wants to place our Access 2000 tables on an SQL server due to the fact the tables are quite large. With that said, can we still use the Access queries or do we have to do...
1
by: Johann Blake | last post by:
I am looking for a good solution on how to implement data access in an application so that there is a clean separation between the data access layer, the business layer and the GUI layer. I am...
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...
9
by: reshugoyal | last post by:
Hi, I need to implement Auto Updates in my application wherein I will be installing the application using msi. First time I will be installing it through CD.( Directly running the MSI file)...
13
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those...
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
by: Erick | last post by:
I'm trying to create a single DLL which all developers in our organisation will reference. I want to place inside it the Microsoft Enterprise Libraries. And expose them out through the DLL. On...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.