Solved

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

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
OneNote and SharePoint 10 58
Folder & Document Sharing Externally 5 43
SharePoint Online/365 with SAP API 2 67
SharePoint Designer 2010 - Format Item As Changed 2 19
Work Over Net is a new and very powerful collaboration product. With its new easy interface it is becoming very competitive to other similar products like webex and office interactive. WON 2010 have the standard business tools needed for multi-offic…
I used to be SharePoint evangelist in our company, so my Outlook always full of questions about how to do this, or where I can find that. One day I found such an email with the following question: "how to attach 3-State workflow (one of the workflow…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

12 Experts available now in Live!

Get 1:1 Help Now