2 questions about Microsoft Enterprise Library

R

rockdale

Hi, all

I am using Enterprise Library for .NET Framework 2.0 - January 2006 to
access my backend MS SQL database. As now we are consider migrate sql
database to mySQL. What engine (ODBC or MySQL for .NET) should I use so
that the code change wil be minimum?

Also, as the enterprise lib using connectionstrings in web.config to
access the database, is there a way to encrypt this connectionstring,
do I need to change the Enterprise Library. ( I did not find the place
that the DBFactory get the connectionstring)


Thanks a lot
-rockdale
 
S

sloan

The Enterprise Library is supposed to insulate you from the db of choice, as
far as the DotNet is concerned.

You should have a DataLayer object(s).

The datalayer object ~uses the EnterpriseLibrary.Data class as a ~~helper
....

Your datalayer object will return
IDataReaders
DataSets
scalars
and occasionaly voids.

You then only have to put in the correct information in the web.config file
for mySQL.

You don't get a connectionstring from the EnterpriseLibrary. That's not its
function.

Its function is to create an abstract way to talk to ~any datastore, with
the same syntax, regardless of vendor.
All you have to do is set the correct config file settings.


You can look at this blog:
http://sholliday.spaces.live.com/blog/

to see how to create a correct datalayer assembly and object(s).
 
R

rockdale

Well, I guess I did not express myself very clearly.

I implemented the Ent Lib 2.0 data block against SQL database
successfully. The system now is a production system. But now we want to
migrate the database to MySQL. From mySQL website you can find
Connector/Net 1.0 and COnnector/ODBC, further more this link
http://dev.mysql.com/tech-resources/articles/dotnet/index.html#ADO.NET
talks about different approaches to connect to mySQL.

My question is which one should I use so that my code change is
minimum. I guess if I use ODBC then what I need to change is the
connectionstring in my web.config file only, but ODBC may not be the
best choice since it is slow? For Connector/Net1.0 I am not sure
whether Ent Lib 2.0 support it or not and how to implement it to let
Ent Lib 2.0 to support it.


My second question is how can I encrypt the connectionstring in my
web.config file to protect user credential and at the same time the ENt
Lib 2.0 can use the decrypted connectionstring. (where should I decrypt
the connectionstring?)

Sorry for the confusing first post

Thanks again
-rockdale
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top