473,466 Members | 1,565 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Question on how to manage SQL Server connection string

Hello,

I'm developing a web services apllication using SQL Server in mixed mode.
I'm also using WSE 3.0.
For each user in the application there's a corresponding user on the
database. The client always sends the username to the web service for
identification.
I have a connection string stored in the web service for the visual
designed
datasets and for the connection I make manually.
I need that the connection string includes the user information for each
user connecting to the web service, so that when I receive a request
from the
client I can change the connection string for everything done under that
request, including using tableadapters to fill datasets, etc..
What is the best approach to make the web service use the information
received from the client to build a valid connection string that can be
used
only for that specific request, but that is visible to everything in the
web
service, including datasets built using the visual editor?
Thanks in advance for any help given.

Regards,
paulo
Feb 28 '06 #1
3 4787
Hi paulo,

Welcome to the MSDN newsgroup.

From your description, I understand you have an ASP.NET 2.0 webservice
which use WSE 3.0 to secure the communication between client and get the
full credential (username/password) from client user. Also, since you'll
need to make connection to backend sqlserver database which accept SQL
Server authentication mode, you're wondering how to dynamiccally make the
connection(in Tableadapter) use the username/password from the webservice
client user's authenticated credential, correct?

Based on my experience, if you've corrected get the clear text
username/password from client authenticated user in webservice, what we
need to do is how to dynamically assign these credential to the Data
connection's connection string (the Tableadapter). I'm not sure whether
you're currently creating the Tableadaper in your ASP.NET project or in a
separate class library project. IMO, I'd prefer put it in a separate class
library project because that'll provide us more options to customize the
TableAdapter(include the connectionstring...). Here are some options you
can consider:

1. Since in winform or class library project, the DataSet/tableAdatper's
designer generated code is available to us in the xxxx.designer.cs file, we
can manually modify some of them or add our own function to customize the
connection string or the sqlconnection member to use the credentials in our
webservice. (e.g extract the main part from the orginal connection string
and concatenate it with the usename/password from webservice client).

2. If you do not want to modify those designer generated code(since they'll
be regenerated), the Tableadapter has a property named
"Connection--Modifier"(you can find it in the TableAdapter's property
grid), we can set this to "Public" so that we can create our own
SqlConnection instance and assign it to the TableAdapter at runtime, this
is also one possible approach.

Hope these help.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Mar 1 '06 #2
Hello Steven,

Just to thank you for your reply. Using your advice I've found the
solution to the problem.
Thanks!

Regards,
paulo

Steven Cheng[MSFT] wrote:
Hi paulo,

Welcome to the MSDN newsgroup.

From your description, I understand you have an ASP.NET 2.0 webservice
which use WSE 3.0 to secure the communication between client and get the
full credential (username/password) from client user. Also, since you'll
need to make connection to backend sqlserver database which accept SQL
Server authentication mode, you're wondering how to dynamiccally make the
connection(in Tableadapter) use the username/password from the webservice
client user's authenticated credential, correct?

Based on my experience, if you've corrected get the clear text
username/password from client authenticated user in webservice, what we
need to do is how to dynamically assign these credential to the Data
connection's connection string (the Tableadapter). I'm not sure whether
you're currently creating the Tableadaper in your ASP.NET project or in a
separate class library project. IMO, I'd prefer put it in a separate class
library project because that'll provide us more options to customize the
TableAdapter(include the connectionstring...). Here are some options you
can consider:

1. Since in winform or class library project, the DataSet/tableAdatper's
designer generated code is available to us in the xxxx.designer.cs file, we
can manually modify some of them or add our own function to customize the
connection string or the sqlconnection member to use the credentials in our
webservice. (e.g extract the main part from the orginal connection string
and concatenate it with the usename/password from webservice client).

2. If you do not want to modify those designer generated code(since they'll
be regenerated), the Tableadapter has a property named
"Connection--Modifier"(you can find it in the TableAdapter's property
grid), we can set this to "Public" so that we can create our own
SqlConnection instance and assign it to the TableAdapter at runtime, this
is also one possible approach.

Hope these help.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Mar 14 '06 #3
Thanks for your followup Paulo,

Glad that my suggestion is of assistance.

Best Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Mar 15 '06 #4

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

Similar topics

4
by: Benne Smith | last post by:
In our company, i have three servers; 1) a development server (mine only - here i make daily changes and test my stuff) 2) a test server (for the users to test milestone builds - changes weekly)...
2
by: Bob | last post by:
I would like to use integrated security for DB connection for my ASP.NET applications. Since these apps have different databases (SQL Server), I want each app to be able to access its own...
7
by: News | last post by:
Hello, I have to build a program with the future in mind and I need a bit of guidance from a guru or two. My program will start as a multi-user Windows Application built with VB.Net and using an...
8
by: Ben R. | last post by:
Hi all, This is a multipart question. I’ve got an asp.net site that contains an access database. Previously, I would debug by making changes and uploading to my host. Now, I’d like to be...
5
by: Michael Moreno | last post by:
Hello, In a class I have this code: public object Obj; If Obj is a COM object I would like to call in the Dispose() method the following code: ...
4
by: Engineerik | last post by:
I am trying to create a socket server which will listen for connections from multiple clients and call subroutines in a Fortran DLL and pass the results back to the client. The asynchronous socket...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
5
by: jehugaleahsa | last post by:
Hello: What is the point of using a DataTable in ASP .NET? We are unsure how you can use them without 1) rebuilding them every postback, or 2) taking up precious memory. We are not sure how to...
6
by: CSharper | last post by:
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
1
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.