Question

I've developed a custom module on SharePoint which uses a different database from the SharePoint database.

How should I setup this database? Should I show a database configuration form when you first visit the module and then take the database configuration and run the database script? or Is there a better way around to do this? One other thing that came to mind is when the administrator activates the feature I could show a form where I take database configuration input rather taking it when they try to visit the module?

Was it helpful?

Solution

An often used approach is to use a custom application page hosted in Central Administration to manage this. There's a Visual How To by Ted Pattison about creating an application page. Just adapt the approach so that when the feature is activated, your custom page shows up in Central Admin.

Then make that custom admin page the UI for creating and managing your custom database. Karine Bosch has several articles about the controls that SharePoint uses in its admin pages so you can maintain that look and feel. If the database takes a while to create then use SPLongOperation so users see a spinner and feel like something is happening.

It's not a good idea to put heaps of code in feature activation as it's hard to debug - there's not really a UI if things go wrong.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top