C
CSharper
We have a good size project and there we will connect to sql from
different projects. What is the best practice to connect to sql? I am
pretty sure, writing the hard coded is not a good solution. I could
create class which could encapsulate all the tasks for the project and
we create the instance and consume them in the project. But with this
every time, I try to create a new instance I would end up creating a
new sql connection. Do you think, it is a right way to do it or create
a singleton class and all the project share the same instance of
connection?
Thanks,
different projects. What is the best practice to connect to sql? I am
pretty sure, writing the hard coded is not a good solution. I could
create class which could encapsulate all the tasks for the project and
we create the instance and consume them in the project. But with this
every time, I try to create a new instance I would end up creating a
new sql connection. Do you think, it is a right way to do it or create
a singleton class and all the project share the same instance of
connection?
Thanks,