Solved

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

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…

756 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