Web parts and web.config file

I am experimenting with AJAX by creating a new website in VS 2008 but using the SQL 2005 Dev Edition database that I use for a production ASP.NET 2.0 web app. OK until I tried using web parts - when I got a SQL Error which is because the app  is looking for a SQL express database in the app_data folder - because web parts uses personalization. OK, my existing SQL 2005 database has the aspnet... tables in it and the production app uses membership, etc. So I am assuming that the problem is in the web.config file - where you have to specify custom data sources for different services(membership, profiles,etc) I tried copying the connectstring and the custom sections from the original apps config file but still get the SQL server error (SQL Server does not allow remote connection, I believe.) Is there anywhere that gives clear instructions on what needs to be coded in the config file to use the SQL server 2005 instead of the defaut express version? Most info that I haVe seen uses the express database or suggests converting with the command line tool. But my database is already aspnet ready. Any ideas?? Resources? 


DieselDave
0
dieseldave
4/14/2009 2:22:24 PM
asp.net.personalization 3779 articles. 0 followers. Follow

3 Replies
765 Views

Similar Articles

[PageSpeed] 38
Get it on Google Play
Get it on Apple App Store

This may help you:

Adding ASPNETDB.mdf file to SQL Server 2005

 


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
0
vinz
4/14/2009 5:10:04 PM

Unless I am reading this all wrong, this article explains how to use another SQL Express DB in your app. I am trying to use an existing SQL Server 2005 database in a new application. I can create and bind datasets to grids OK by altering the connectstring in the config file, but the connection breaks when i add web parts to a page - apparently because that page is looking for a SQL Express DB that doesnt exist, and the app cant create. I was under the impression that I can change the database to SQL server 2005 by modifying the config file, but that doesnt seem to work. I believe that is what I had to do when I set up the original app but I cant get it to work now!


DieselDave
0
dieseldave
4/15/2009 1:02:52 PM

dieseldave:
Unless I am reading this all wrong, this article explains how to use another SQL Express DB in your app. I am trying to use an existing SQL Server 2005 database in a new application. I can create and bind datasets to grids OK by altering the connectstring in the config file, but the connection breaks when i add web parts to a page - apparently because that page is looking for a SQL Express DB that doesnt exist, and the app cant create. I was under the impression that I can change the database to SQL server 2005 by modifying the config file, but that doesnt seem to work. I believe that is what I had to do when I set up the original app but I cant get it to work now!

Basically, WebParts uses ASPNETDB file to store the personalization of data.. If you want to use your own Database for storing the personalize data then you need to create your own Personalization Providers for storing the webparts personalization data.. Check these links for your references.

WebPart Personalization Providers

Custom Provider Based Service

Let me know if you have any more clarifications.

 


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
0
vinz
4/15/2009 1:32:20 PM
Reply: