1

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?

1 Answer 1

1

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.

3
  • The best answer I ever had on sharepointoverflow. love'ya! Commented Feb 23, 2010 at 12:56
  • Thanks Alex. Any idea how to open an application page on feature activation? Commented Feb 23, 2010 at 13:01
  • @Ramiz: Happy to help! I don't know if you can redirect once the feature has been activated. Ask a new question about this as someone else might! Commented Feb 24, 2010 at 2:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.