Solved

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

Posted on 2011-03-08
2
537 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 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
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…

717 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