Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Sharepoint WebPart backend configuration?

Posted on 2011-03-12
4
Medium Priority
?
626 Views
Last Modified: 2012-06-21
Hello everyone,

I am developing a Sharepoint Web Part, that connects to some external resources.  I am fully familiary with the programming aspects of Web Parts, however, I want to give my customer some flexibilty around the configuration of the Web Part.  For example, lets say I need to connect to a database, I would like for there to be a way to configure the web part to connect to a certain dabase, without hardcoding.

I assume I could use xml configuration files, which is all fine, but I was wondering if there is a more GUI driven way to configure web parts in Sharepoint?

Hope that makes sense!

Cheers,

DB
0
Comment
Question by:dbridle
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
EagleUK earned 1000 total points
ID: 35119917
As I understand it, the way to do this is to add Custom Properties to your Web Part to capture the relevant database connections string, User ID, and password in the Properties pane. The Web Part will persist the information automatically.

To see an overview of the process, review http://msdn.microsoft.com/en-us/library/ms948927.aspx. This is an older 2003 article, but will get you started.

This approach will allow you to capture simple connection strings, etc. If you wish to develop a more robust interface, you might want to create a custom Tool Part. See http://msdn.microsoft.com/en-us/library/dd584178.aspx.

Writing a custom Web Part to connect to a database is not trivial, so you'll probably have to do a lot of research. I don't know of any books that cover this to a satisfactory depth, but hopefully someone else will jump in with a reference.
0
 

Author Comment

by:dbridle
ID: 35120874
Eagle,

Thank you for your response.  I do not need to connect to a database I just used that as an example.

I will look into custom properties, but how are the custom properties configured? I will also check the Tool Part, which might do the job as what I need is very complex.  I was hoping it was kind of back end front end, configure the back end and hte front end will react to those configs (the web part).
0
 
LVL 7

Expert Comment

by:EagleUK
ID: 35121276
The approach could be the same, regardless of the external source. The custom Properties/Tool Part approach provides the GUI, and then you reference the values in your web part code. If you look at a third-party web part and go into Modify Web Part, you'll usually see additional categories and settings. Those are what I'm referring to.

If you explain in more detail what you are trying to do, someone might already have a solution that they can recommend.
0
 

Author Comment

by:dbridle
ID: 35122029
Happy with the link you sent, its what I am looking for. Thanks!
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month20 days, 15 hours left to enroll

810 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