A webserivce that connects to different providers

J

J-T

Hello,

I am trying to create a web service which has 3 parameters.

1) Datasource
2)USerName
3)Password

based on datasource and in the run time ,I have to switch between data
identity providers like sql server,AD, oracle and even another
authentication webservice. Can somebody gives me a clue how to program
this?.Shall I store all data source in web.config and in run-time based on
the first paramter go through switch case statment or create classes and
interfaces for it .? I could n't find any samples that can give me some
idea.


Thankls for you time in advance.

Janathon
 
N

Nicholas Paldino [.NET/C# MVP]

Janathon,

Well, basically, you will want to use the interfaces that are
implemented on the different connections/data-adapters and whatnot.

You might want to look into the Data block in the Enterprise Library.
They have pretty good abstractions for the different databases. Of course,
this means you might have to tweak some things (depending on whether or not
you use stored procs or dynamic/embedded sql).

Also, if you are using .NET 2.0, you might not need the enterprise
application blocks, since the classes for data access have been changed so
that they all derive from common base classes (which means you can use the
abstractions).

Hope this helps.
 
J

J-T

Hello Nicholas,

I am using .Net Framework 2.0 ,so as you said there is no need for
enterprise library. Can you guide me to the some docs or examples of this?

Thanks a lot

Nicholas Paldino said:
Janathon,

Well, basically, you will want to use the interfaces that are
implemented on the different connections/data-adapters and whatnot.

You might want to look into the Data block in the Enterprise Library.
They have pretty good abstractions for the different databases. Of
course, this means you might have to tweak some things (depending on
whether or not you use stored procs or dynamic/embedded sql).

Also, if you are using .NET 2.0, you might not need the enterprise
application blocks, since the classes for data access have been changed so
that they all derive from common base classes (which means you can use the
abstractions).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

J-T said:
Hello,

I am trying to create a web service which has 3 parameters.

1) Datasource
2)USerName
3)Password

based on datasource and in the run time ,I have to switch between data
identity providers like sql server,AD, oracle and even another
authentication webservice. Can somebody gives me a clue how to program
this?.Shall I store all data source in web.config and in run-time based
on the first paramter go through switch case statment or create classes
and interfaces for it .? I could n't find any samples that can give me
some idea.


Thankls for you time in advance.

Janathon
 
N

Nicholas Paldino [.NET/C# MVP]

J-T,

If you look at the inheritance tree for SqlDataAdapter, SqlConnection,
SqlCommand, etc, etc, you will notice that they all derive from common base
classes (which the ole-db, odbc provider derive from as well). Once you
know where you have to get your data from, you can create an instance of
this provider, and then reference only the methods on the base classes
shared by all.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

J-T said:
Hello Nicholas,

I am using .Net Framework 2.0 ,so as you said there is no need for
enterprise library. Can you guide me to the some docs or examples of this?

Thanks a lot

Nicholas Paldino said:
Janathon,

Well, basically, you will want to use the interfaces that are
implemented on the different connections/data-adapters and whatnot.

You might want to look into the Data block in the Enterprise Library.
They have pretty good abstractions for the different databases. Of
course, this means you might have to tweak some things (depending on
whether or not you use stored procs or dynamic/embedded sql).

Also, if you are using .NET 2.0, you might not need the enterprise
application blocks, since the classes for data access have been changed
so that they all derive from common base classes (which means you can use
the abstractions).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

J-T said:
Hello,

I am trying to create a web service which has 3 parameters.

1) Datasource
2)USerName
3)Password

based on datasource and in the run time ,I have to switch between data
identity providers like sql server,AD, oracle and even another
authentication webservice. Can somebody gives me a clue how to program
this?.Shall I store all data source in web.config and in run-time based
on the first paramter go through switch case statment or create classes
and interfaces for it .? I could n't find any samples that can give me
some idea.


Thankls for you time in advance.

Janathon
 

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

Top