Sl provider Micorosft sample driver ....

venerdì 19 giugno 2009 - 20.33

Anonimo Profilo | Senior Member

]Salve, ho ricompilato la dll , per il mio hoster che non vuole che si utilizzi l'dbo.
però Io ho generato il file .sql con publish wizard etc..
però avviando il sito mi da questo errore:

Errore server nell'applicazione '/'.
The 'Microsoft.Samples.SqlRoleProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.
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.Configuration.Provider.ProviderException: The 'Microsoft.Samples.SqlRoleProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.

Errore nel codice sorgente:

Riga 48: {
Riga 49: lbxAvailableRoles.SelectedIndex = -1;
Riga 50: lbxAvailableRoles.DataSource = Roles.GetAllRoles();
Riga 51: lbxAvailableRoles.DataBind();
Riga 52:

come mai?.

grazie.
il mio codice:
Il codice sorgente non è stato renderizzato qui
perchè non c'è sufficiente spazio.
Clicca qui per visualizzarlo in una nuova finestra

Mi potete aiutarmi?.
grazie.



-------------------------------------------
SCUSATE; HO RISOLTO. cercando l'errore su google.

Schema compatiblity error in configuring SqlMembershipProvider

I was working with one of my projects in which I had to use Membership/Role providers. I run the wizard using aspnet_regsql.exe to create the structure of SqlMembershipProvider. I added few roles and users using ASP.Net Configuration. Everything worked fine tested my application multiple times and it worked very well. Then I generated the script from my local database for SqlMembershipProvider since we can not run the utility aspnet_regsql.exe on our test server. Everything went well so far. All the tables, views, stored procedures, roles were created and permissions were granted. Then when I try to run my application from the test server it gave me following error.

"The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version."

This was a bit confusing error for me since I had worked with SqlMembershipProvider in the past. Then I start recalling the difference between my previous and current deployment and the difference was in ealier deployments either I used aspnet_regsql.exe or copied the structure with data but this time I created the script and generate the structure.

Still no sign for me to detect the cause of error. Then I started checking the tables and I found that when we run aspnet_regsql.exe it not only creates the structure but insert some values as well in "aspnet_SchemaVersions" table which were missing in my test server. So created manual insert script to add following values.

-- --Table: [dbo].[aspnet_SchemaVersions]
-- --Insert
INSERT INTO [dbo].[aspnet_SchemaVersions] ([Feature], [CompatibleSchemaVersion], [IsCurrentVersion]) VALUES(N'common', N'1', 1)
INSERT INTO [dbo].[aspnet_SchemaVersions] ([Feature], [CompatibleSchemaVersion], [IsCurrentVersion]) VALUES(N'health monitoring', N'1', 1)
INSERT INTO [dbo].[aspnet_SchemaVersions] ([Feature], [CompatibleSchemaVersion], [IsCurrentVersion]) VALUES(N'membership', N'1', 1)
INSERT INTO [dbo].[aspnet_SchemaVersions] ([Feature], [CompatibleSchemaVersion], [IsCurrentVersion]) VALUES(N'personalization', N'1', 1)
INSERT INTO [dbo].[aspnet_SchemaVersions] ([Feature], [CompatibleSchemaVersion], [IsCurrentVersion]) VALUES(N'profile', N'1', 1)
INSERT INTO [dbo].[aspnet_SchemaVersions] ([Feature], [CompatibleSchemaVersion], [IsCurrentVersion]) VALUES(N'role manager', N'1', 1)


BINGO!!! After inserting these values my test server started working as good as my local machine :).
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5