?
Solved

Can a web part have its own web.config file and Windows Authentication

Posted on 2011-03-08
2
Medium Priority
?
541 Views
Last Modified: 2012-05-11
Hi,

I have created a web part that communicates with a SQL Server database.  I would like to encrypt the connection string inside the web.config file, however, I read that there is a performance penalty involved when encrypting/decryption the connection string.  Is it possible for for a web part to have its own web.config file?

Also, SQL Server authentication has been set to "Windows Authentication mode" only.  When attempting to hit the database via the web part, under what account does it take place?  Is it under the application pool setting or the currently logged in user.  

thanks
0
Comment
Question by:yechan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
psv1973 earned 1000 total points
ID: 35070075
A Web.config file is the configuration file forthe web application. So you can't have a webpart.web.config file. If you need settting for the web part then it's better to use the property bag. to store the connection string.

This toool might also help if you go down this route:
http://pbs2010.codeplex.com/


If you use elevated permissions the application pool account will be used otherwise the logged in user.

0
 
LVL 6

Assisted Solution

by:ThatSharepointGuy
ThatSharepointGuy earned 1000 total points
ID: 35072566
The connection should run under the credentials specified within the web application.  It *might* use the account that has permissions to your SQL server, but I'm betting that it's going to be the web application account (probably farm account).
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Last week I faced a strange issue recently, i have deployed SharePoint 2003 servers for one project and one of the requirements was to open SharePoint site from same server. when i was trying to open site from the same server i was getting authentic…
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question