WSP and Data Access

Dec 15, 2010 at 10:00 PM


I'm creating a web based application for Sharepoint Services 3.0 using WSPBuilder. My visual studio solution contains two projects. The first is the WSPBuilder package and the second is a web application. I was able to call the the web application control into the WspBuilder solution through the CreateChildControl() method.

In addition, I was aboe to succesfully add the project to the GAC and succesfuly build and deploy the WSPBuilder to the 12 hive. Also, I was able to activate, add and see the new web part in sharepoint.

The Problem:

I need to access data from a SQL 2005 database that it is on the same server where Sharepoint Services 3.0 is and also where I'm developing my project. If I add a SqlConnectionString into my Asp.Net web application I can compile the project without any errors. However, after succesfully building and deploying the WSPbuilder app, the sharepoint page goes to an error page. I looked into the Event Viwer and I found the following:

Load control template file /_controltemplates/ArgoBranchReportControl.ascx failed: The connection name 'HIR_ConnectionString' was not found in the applications configuration or the connection string is empty.

The same occurs when I just use a simple Linq query (by the way I also have a .dbml file inside the web application)

I don't know how to approach the situation. I would assume that by loading the control in the WSPBuilder project it will inherit all the controls and objects from the control being loaded.

So, the question is how can I manipulate data by using the WSPBuilder approach?

Any help will be so greatly appreciated.

Windows Server 2003 - SqlServer 2005, SharePoint Services 3.0, Visual Studio 2008, .NET 3.5