Salve, sto usando lo startkit di clubsite , lo tutto configurato nel db sql server non quello .mdf,
però c'è una cosa strana , quando lo lancio mi esce questo errore:
Errore server nell'applicazione '/'.
Il nome di oggetto 'SiteSettings' non è valido.
Descrizione: Eccezione non gestita durante l'esecuzione della richiesta Web corrente. Per ulteriori informazioni sull'errore e sul suo punto di origine nel codice, vedere l'analisi dello stack.
Dettagli eccezione: System.Data.SqlClient.SqlException: Il nome di oggetto 'SiteSettings' non è valido.
Errore nel codice sorgente:
Riga 2186: this.Adapter.SelectCommand = this.CommandCollection[0];
Riga 2187: DataSet.SiteSettingsDataTable dataTable = new DataSet.SiteSettingsDataTable();
Riga 2188: this.Adapter.Fill(dataTable);
Riga 2189: return dataTable;
Riga 2190: }
File di origine: c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\68adf22d\961289ac\App_Code.kaeh1xe8.9.cs Riga: 2188
Analisi dello stack:
[SqlException (0x80131904): Il nome di oggetto 'SiteSettings' non è valido.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33
System.Data.SqlClient.SqlDataReader.get_MetaData() +83
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +10
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +130
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +115
DataSetTableAdapters.SiteSettingsTableAdapter.GetSiteSettings() in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\68adf22d\961289ac\App_Code.kaeh1xe8.9.cs:2188
DevCowSiteSettings.GetSiteSettings() in d:\ClubSite\App_Code\SiteSettings.cs:49
DevCow.Web.UI.DevCowThemePage.Page_PreInit(Object sender, EventArgs e) in d:\ClubSite\App_Code\DevCowThemePage.cs:20
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Page.OnPreInit(EventArgs e) +8698174
System.Web.UI.Page.PerformPreInit() +31
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282
Informazioni di versione: Versione di Microsoft .NET Framework:2.0.50727.3074; Versione di ASP.NET:2.0.50727.3074
è il codice incrminato è questo:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace DevCow.Web.UI
{
/// <summary>
/// Summary description for DevCowThemePage
/// </summary>
public class DevCowThemePage: Page
{
protected void Page_PreInit(object sender, EventArgs e)
{
string strSiteThem = DevCowSiteSettings.GetSiteSettings().SiteTheme;
if(strSiteThem != "")
{
Page.Theme = strSiteThem;
}
}
}
} ed il webconfig fatto da me:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="ClubSiteDB" connectionString="data source='NB-Luigi\SQLEXPRESS';User ID='sa';Password=cane;database='personalsite'"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<xhtmlConformance mode="Strict"/>
<membership defaultProvider="SqlProvider">
<providers>
<add name="SqlProvider"
type="Microsoft.Samples.SqlMemberShipProvider, ProviderToolkitSampleProviders"
connectionStringName="ClubSiteDB"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="/"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="3"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</providers>
</membership>
<profile enabled="true" defaultProvider="SqlProfileProvider">
<providers>
<add name="SqlProfileProvider"
connectionStringName="ClubSiteDB"
applicationName="/"
type="Microsoft.Samples.SqlProfileProvider, ProviderToolkitSampleProviders" />
</providers>
</profile>
<roleManager enabled="true" defaultProvider="SQLRoleProvider">
<providers>
<add name="SQLRoleProvider"
connectionStringName="ClubSiteDB"
applicationName="/"
type="Microsoft.Samples.SQLRoleProvider, ProviderToolkitSampleProviders" />
</providers>
</roleManager>
<authentication mode="Forms"/>
<compilation debug="true" />
<siteMap defaultProvider="AspNetXmlSiteMapProvider" enabled="true">
<providers>
<remove name="AspNetXmlSiteMapProvider"/>
<add name="AspNetXmlSiteMapProvider" description="SiteMap provider which reads in .sitemap XML files." type="System.Web.XmlSiteMapProvider" securityTrimmingEnabled="true" siteMapFile="Web.sitemap"/>
</providers>
</siteMap>
<!--<customErrors mode="RemoteOnly" defaultRedirect="ErrorPage.htm"/>-->
<customErrors mode="Off"/>
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
</system.web>
<location path="events_edit.aspx">
<system.web>
<authorization>
<allow roles="Administrators"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<location path="admin">
<system.web>
<authorization>
<allow roles="Administrators"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<location path="locations_edit.aspx">
<system.web>
<authorization>
<allow roles="Administrators"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<location path="news_edit.aspx">
<system.web>
<authorization>
<allow roles="Administrators"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<location path="photoalbum_new.aspx">
<system.web>
<authorization>
<allow roles="Administrators"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<location path="member_list.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
<location path="member_details.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
</configuration>
mi date una mano?.
grazie.
Perchè da quell'errore lì. e pur non avendo modificato nulla?.
grazie.