Advertisement

05.02.2008 at 11:06AM PDT, ID: 23372474
[x]
Attachment Details

Data Layer

Asked by erenpasa in Visual Studio .NET 2005, C# Programming Language, Microsoft Visual C#.Net

Tags: c#, .net 2005

Hi There,
I want to develop a data layer.I think like that i can set data layer's provider. I have to use access database and sql server. But i don't want to write 1 differetent class. I hope i can explain my problem.
But i don't want to use swicth. For example if ole db return that,if sqlconnection return that... i don't want to like this.
Thanks to allStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
class Data
    {
        object _connection;
        public object openConnection()
        {
            //I want to set this sqlconnection object.
            //For example when i set a prop this method return me a oledb connection
            ((SqlConnection)_connection).ConnectionString = "bla bla bla";
            ((SqlConnection)_connection).Open();
            return _connection;
        }
 
    }
[+][-]05.02.2008 at 11:21AM PDT, ID: 21488864

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio .NET 2005, C# Programming Language, Microsoft Visual C#.Net
Tags: c#, .net 2005
Sign Up Now!
Solution Provided By: Hendo1973
Participating Experts: 2
Solution Grade: B
 
 
[+][-]05.02.2008 at 11:23AM PDT, ID: 21488876

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.02.2008 at 11:42AM PDT, ID: 21489046

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628