Using SQL instead of XML

Last post 06-10-2009 10:22 PM by newbie495. 4 replies.

Sort Posts:

  • Using SQL instead of XML

    04-02-2007, 2:43 PM
    • Member
      point Member
    • tman126
    • Member since 02-21-2007, 4:06 PM
    • Posts 2

    Hello Everyone.

    I downloaded the Small Business Starter Kit, and I need to use the news system. The provider that comes for default is the XML, but I wanted to be able to show data from the SQL News Table.

    How can I turn off XML and use only the Sql tables in this starter kit.

    Thanks

    __________

    TMAN

  • Re: Using SQL instead of XML

    04-02-2007, 5:56 PM
    • Member
      34 point Member
    • figgie
    • Member since 03-14-2007, 7:47 PM
    • Posts 24

    I know I have seen this answered here before.

     

    Need to go into your web.config and change providers from xmlpr 

    1    
    2    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    3      <!-- Register a new config section-->
    4      <configSections>
    5        <section name="SmallBusinessDataProviders" type="SmallBusinessDataProvidersSection" requirePermission="false"/>
    6      </configSections>
    7      <!-- Connection string, currently configured for SQL Express-->
    8      <connectionStrings>
    9        <remove name="SQLConnectionString"/>
    10       <add name="SQLConnectionString" connectionString="Data Source=.\SQLExpress;integrated security=true;attachdbfilename=|DataDirectory|SmallCompanyDB.mdf;user instance=true"/>
    11     </connectionStrings>
    12     <!-- Register the providers and specify which ones to use for data access for each of the 4 pages-->
    13      change these entries to SQLProvider<SmallBusinessDataProviders peopleProviderName="sqlProvider" testimonialsProviderName="sqlProvider" catalogProviderName="sqlProvider" newsProviderName=""sqlProvider">
    14       <!-- Register providers for People - Similarly for other pages-->
    15       <PeopleProviders>
    16         <add name="sqlProvider" type="SqlPeopleProvider" connectionStringName="SQLConnectionString"/>
    17         <add name="xmlProvider" type="XmlPeopleProvider" schemaFile="People.xsd" dataFile="People.xml"/>
    18       </PeopleProviders>
    19       <TestimonialsProviders>
    20         <add name="sqlProvider" type="SqlTestimonialProvider" connectionStringName="SQLConnectionString"/>
    21         <add name="xmlProvider" type="XmlTestimonialProvider" schemaFile="Testimonials.xsd" dataFile="Testimonials.xml"/>
    22       </TestimonialsProviders>
    23       <CatalogProviders>
    24         <add name="sqlProvider" type="SqlCatalogProvider" connectionStringName="SQLConnectionString"/>
    25         <add name="xmlProvider" type="XmlCatalogProvider" schemaFile="Products.xsd" dataFile="Products.xml"/>
    26       </CatalogProviders>
    27       <NewsProviders>
    28         <add name="sqlProvider" type="SqlNewsProvider" connectionStringName="SQLConnectionString"/>
    29         <add name="xmlProvider" type="XmlNewsProvider" schemaFile="News.xsd" dataFile="News.xml"/>
    30       </NewsProviders>
    31     </SmallBusinessDataProviders>
    32     <system.web>
    33   	  <compilation debug="false"/>
    34       <customErrors mode="RemoteOnly" defaultRedirect="CustomError.aspx"/>
    35       <pages theme="Standard"/>
    36     </system.web>
    37   </configuration>
    
     ovider to sqlprovider and change all the commented stuf

  • Re: Using SQL instead of XML

    04-02-2007, 6:42 PM
    • Member
      point Member
    • tman126
    • Member since 02-21-2007, 4:06 PM
    • Posts 2

    Thanks,

    After a while I saw the <SmallBusinessDataProviders peopleProviderName="sqlProvider" testimonialsProviderName="sqlProvider" catalogProviderName="sqlProvider" newsProviderName=""sqlProvider"> and it was ok.

     

  • Re: Using SQL instead of XML

    04-17-2009, 12:21 AM
    • Member
      10 point Member
    • artistone
    • Member since 04-02-2009, 3:46 AM
    • Posts 5

    Hello

    Are you using SQL server express or SQL Server 2005? Did you change anything else in the connection string? Did you make any modifications in the database, or attach the provided database in SQL? I'd be glad if you could guide me with step-by-step information because this is really breaking my head now.

    Thanks

    Sub

  • Re: Using SQL instead of XML

    06-10-2009, 10:22 PM
    • Member
      2 point Member
    • newbie495
    • Member since 01-14-2008, 8:23 PM
    • Posts 3

    I have SBSK running on my local machine and have tried using SQL Express by replacing xmlProvider with sqlProvider.  Now I keep getting:

    Server Error in '/Website1' Application.

    Object reference not set to an instance of an object.

    System.NullReferenceException:  Object reference not set to an instance of an object.

    Line 50:         _provider = ProvidersHelper.InstantiateProvider(_providersSection.NewsProviders[_providersSection.NewsProviderName],

    Any ideas???  Thank you.

    Eddie

Page 1 of 1 (5 items)