Solved

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

Posted on 2011-03-08
2
493 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
2 Comments
 
LVL 6

Accepted Solution

by:
psv1973 earned 250 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 250 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There is one common problem that all we SharePoint developers share: custom solution deployment. This topic can't be covered fully in this short article, so all I want to do in this one is to review it from a development-to-operations perspectiv…
Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now