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

Connection string for all the layers

I have a solution which contains windows,web,mobile presentations. Now i want to share the connection string in the web.config file.

i want to write a method in a common layer where i can retrieve the connection string for all the presentations layers

How can i do that? Any suggestions or urls are suggested?

Thank you
Jul 21 '05 #1
3 2122
Why would a mobile solution want the same connection string as a web app?
Are they connecting to the same database?

If so, wouldn't you want to have your data layer in one place? And if so,
I'd think you'd want to place that data layer under web services, so that
only the data layer would have the connection string... The rest would
access the web services instead.

Have a default value in the installed config file that points to the web
services server, and allow the user to change it. That way, if you change
your URL, then folks who already have your app installed can change the
value through a U/I, and not by editing the config file.

Good Luck,
--- Nick

"Varun" <Va***@discussions.microsoft.com> wrote in message
news:47**********************************@microsof t.com...
I have a solution which contains windows,web,mobile presentations. Now i want to share the connection string in the web.config file.
i want to write a method in a common layer where i can retrieve the connection string for all the presentations layers
How can i do that? Any suggestions or urls are suggested?

Thank you

Jul 21 '05 #2
Hi Nick
Thank you for ur reply
I didnt get the clear idea how i can have connection string under datalayer, for both windows and web forms.
Please can you give me a clear idea. And yes i am using the same database fro both the forms.

Thank you


"Nick Malik" wrote:
Why would a mobile solution want the same connection string as a web app?
Are they connecting to the same database?

If so, wouldn't you want to have your data layer in one place? And if so,
I'd think you'd want to place that data layer under web services, so that
only the data layer would have the connection string... The rest would
access the web services instead.

Have a default value in the installed config file that points to the web
services server, and allow the user to change it. That way, if you change
your URL, then folks who already have your app installed can change the
value through a U/I, and not by editing the config file.

Good Luck,
--- Nick

"Varun" <Va***@discussions.microsoft.com> wrote in message
news:47**********************************@microsof t.com...
I have a solution which contains windows,web,mobile presentations. Now i

want to share the connection string in the web.config file.

i want to write a method in a common layer where i can retrieve the

connection string for all the presentations layers

How can i do that? Any suggestions or urls are suggested?

Thank you


Jul 21 '05 #3
Hi Varun,

So you aren't worried about mobile?

As for windows vs. Web, will the windows forms be using a data layer that is
on the web server, or a third location, or will the data layer be deployed
directly to the client machines?

I recommend that you set up a service that provides data access. The
service can use .NET remoting, or SOAP web services, or both, to communicate
with it's clients.

The web interface can use the service, as can the windows clients.

The service can place it's connection string in it's config file, or the
registry.

The web app would need the URL of the data access service, as would the
client components, probably in their own config files.

Does this make sense?

--- Nick

P.S. In the simplest scenario, where the windows client and the web clients
always run on the same server, just put the connection string in the
registry. This is not a common solution, so it's not the most useful
choice.
"Varun" <Va***@discussions.microsoft.com> wrote in message
news:25**********************************@microsof t.com...
Hi Nick
Thank you for ur reply
I didnt get the clear idea how i can have connection string under datalayer, for both windows and web forms. Please can you give me a clear idea. And yes i am using the same database fro both the forms.
Thank you


"Nick Malik" wrote:
Why would a mobile solution want the same connection string as a web app? Are they connecting to the same database?

If so, wouldn't you want to have your data layer in one place? And if so, I'd think you'd want to place that data layer under web services, so that only the data layer would have the connection string... The rest would
access the web services instead.

Have a default value in the installed config file that points to the web
services server, and allow the user to change it. That way, if you change your URL, then folks who already have your app installed can change the
value through a U/I, and not by editing the config file.

Good Luck,
--- Nick

"Varun" <Va***@discussions.microsoft.com> wrote in message
news:47**********************************@microsof t.com...
I have a solution which contains windows,web,mobile presentations. Now
i want to share the connection string in the web.config file.

i want to write a method in a common layer where i can retrieve the

connection string for all the presentations layers

How can i do that? Any suggestions or urls are suggested?

Thank you


Jul 21 '05 #4

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

Similar topics

3
by: sjanie | last post by:
The error code is: Microsoft JScript compilation error '800a03ec' Expected ';' /bicc.nl/Connections/BICCwebsite.asp, line 2 Set Conn = Server.CreateObject("ADODB.Connection") ----^
0
by: Varun | last post by:
Hi Nick Thank you for ur reply I didnt get the clear idea how i can have connection string under datalayer, for both windows and web forms. Please can you give me a clear idea. And yes i am using...
3
by: Varun | last post by:
I have a solution which contains windows,web,mobile presentations. Now i want to share the connection string in the web.config file. i want to write a method in a common layer where i can retrieve...
2
by: AS | last post by:
Hi, I have a C# windows desktop application that will be used only by one user at a time. The database server (SQL Server 2000) also resides on that machine only. This application has three...
4
by: Frank | last post by:
I am developing with VS.NET 2003 on the ASP.NET 1.1 platform. I have created a small app that interacts with an existing Access 97 db. At this point in time, my higher ups are unwilling to...
1
by: Jon | last post by:
Hello all - just a spot of advice required. I'm wanting to write a number of data layers that will be used to carry out the typical CRUD operations against a database - so 1 database will be...
4
by: Francisco Domingues | last post by:
Hi all, Someone can help me in accomplish a connection to 2 wms services. I could connect once but I changed something on the code and now I can't get the things work, the connection fails....
2
by: Hetal | last post by:
Hi... I am a newbie VB.NET developer and i am looking at working with ADO.NET rather than ADO. In one of our native VB application with ADO, we used to create 1 connection object and that would...
20
by: Author | last post by:
a .net 1.1 app has a class whose constructor opens a db connection to sql svr two thousand. this class has more than a dozen of methods. most of them don't do db stuff. I am wondering if this...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.