Page view counter

sql express mandatory for web parts?

Last post 05-21-2008 11:37 AM by fabricari. 8 replies.

Sort Posts:

  • sql express mandatory for web parts?

    06-29-2005, 4:12 AM
    • Loading...
    • edmars
    • Joined on 12-01-2003, 8:55 PM
    • Posts 23
    • Points 115
    Hi all,
    I have just installed CLR 2.0 on an Application Windows Server 2003, which of course had ASP.NET 1.1 before, using the "dotnetfx.exe" download from http://www.microsoft.com/downloads/details.aspx?FamilyId=7ABD8C8F-287E-4C7E-9A4A-A4ECFF40FC8E&displaylang=en. I can now run ASP 2 websites on it perfectly ok, but if I use just a Web Part Manager and Web Part Zone just by themselves from the toolbox with nothing else complicating the scenario, I get a runtime error "Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. " which occurs when the program tries to open a sqlConnection. In the list of configuration requirements it says among other things "SQL Server Express must be installed on the machine. " I have SQL 2000 Enterprise on my machine already, and so was hoping that I would be able to use that for all my SQL requirements. Can anyone tell me either what I am missing, or simply how to configure the project to use my SQL 2000 instead of looking for the express version which comes with VS2005.

    Thanks a lot for any help!
    -Eddie
  • Re: sql express mandatory for web parts?

    06-29-2005, 12:07 PM
    • Loading...
    • shaalim
    • Joined on 05-01-2005, 8:50 PM
    • Posts 16
    • Points 80

    By default, web parts uses the SQL 2005 Express provider for data storage. To use SQL Server 2000, you need to do some work:

    1. Use the aspnet_regsql.exe tool located in
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\ to prepare SQL Server 2000. Essentially it will add the aspnetdb database.

    2. In Web.config, add the following:

    <connectionStrings>
    <add name="myconnstring"
    connectionString="Data Source=your_server_name;Initial Catalog=aspnetdb;Integrated Security=True"
    providerName="System.Data.SqlClient" />
    </connectionStrings>

    <system.web>
    ...
    ...

    <webParts>
    <personalization
    defaultProvider="SqlPersonalizationProvider">
    <providers>
    <add name="SqlPersonalizationProvider"
    type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider"
    connectionStringName="myconnstring"
    applicationName="/" />
    </providers>
    <authorization>
    <deny users="*" verbs="enterSharedScope" />
    <allow users="*" verbs="modifyState" />
    </authorization>
    </personalization>
    </webParts>
    </system.web>

    That should work fine for you.

    For More details visit ...
    http://www.ondotnet.com/pub/a/dotnet/2005/05/23/webparts_1.html?page=2



    Regards
    --
    Shaalim

  • Re: sql express mandatory for web parts?

    06-29-2005, 12:18 PM
    • Loading...
    • JoeBerg
    • Joined on 08-20-2004, 1:08 PM
    • Redmond
    • Posts 176
    • Points 880

    If you want to use your own SQL server (rather than SQL Express by default), then you will need to run aspnet_regsql.exe from the X:\WINDOWS\Microsoft.NET\Framework\v2.0.50215 folder. Running that tool will launch a wizard that will help you to configure your SQL database; you just need to type in your SQL server hostname then your credentials and finally the database name under which you want the auto-generated tables to be added. The tool with create the required database/tables for Membership, Role, Profile and Personalization.

    Once this is done, you can add your own personalization provider (for example) in your web.config. You need to do something like this:

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
      <connectionStrings>
           <add name="wPartConn" connectionString="server=YOUR_SERVER_HOSTNAME;database=YOUR_DATABASE_NAME;uid=xxxxx;pwd=xxxxxxx" />
      </connectionStrings>  
      <system.web>
          <webParts>
            <personalization defaultProvider="Sql">
              <providers>
                <add name="Sql" type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider" connectionStringName="wPartConn" applicationName="/" />
              </providers>          
            </personalization>
          </webParts>
     </system.web>
    </configuration>

    Hope this helps!
    Joe

  • Re: sql express mandatory for web parts?

    06-30-2005, 4:03 AM
    • Loading...
    • edmars
    • Joined on 12-01-2003, 8:55 PM
    • Posts 23
    • Points 115
    thanks a lot for the help, shaalim and JoeBerg. That resolved my problem!
  • Re: sql express mandatory for web parts?

    07-27-2005, 10:50 AM
    • Loading...
    • bttrflii
    • Joined on 06-28-2005, 8:33 PM
    • Posts 132
    • Points 590
    mine too.  i was starting to get pretty frustrated.  :)  perhaps this should be added to the quickstart tutorials?


    thanks!

    ~ cj
  • Re: sql express mandatory for web parts?

    07-27-2005, 12:47 PM
    • Loading...
    • JoeBerg
    • Joined on 08-20-2004, 1:08 PM
    • Redmond
    • Posts 176
    • Points 880
    Yes, this information will be available through the WebParts Walkthroughs.

    Thanks,
    Joe
  • Re: sql express mandatory for web parts?

    09-12-2007, 2:50 AM
    • Loading...
    • deeps.mcts
    • Joined on 09-12-2007, 5:48 AM
    • Posts 2
    • Points 4

    thank you very much...it worked

    But the problem is ,the minimize,close,edit links(webpart verb render mode) are not displayed on runtime..please help

     

    thanks,

    deepak

  • Re: sql express mandatory for web parts?

    09-12-2007, 2:50 AM
    • Loading...
    • deeps.mcts
    • Joined on 09-12-2007, 5:48 AM
    • Posts 2
    • Points 4

    thank you very much...it worked

    But the problem is ,the minimize,close,edit links(webpart verb render mode) are not displayed on runtime..please help

     

    thanks,

    deepak

  • Re: sql express mandatory for web parts?

    05-21-2008, 11:37 AM
    • Loading...
    • fabricari
    • Joined on 05-21-2008, 11:33 AM
    • Posts 2
    • Points 4

     This thread was very helpful for setting up User Profiles with Web Parts. However, it seems that it's not required if you change the default to:

    <asp:WebPartManager ID="WebPartManager1" runat="server" >
                <Personalization Enabled="False" />
            </asp:WebPartManager>

     Update: I've also found that the reason SQL Express isn't working any more with Web Parts and Login controls is because my computer recently had SQL Server Management Studio installed, and the admin had to uninstall SQL Express. So, it's just a matter of pointing to the new database (as detailed above). For a while there I was going nuts trying to figure out why it used to work, and suddenly stopped. Hope that helps anyone having a similar problem.
     


Page 1 of 1 (9 items)