Sql-server – Setting up ASP.NET Membership provider for an application

asp.netsql serversql-server-2005wiki

I recently downloaded DotWiki which I plan on using for a support section for my companies website. The application itself has two different security modes "simple" and "full". Full uses an ASP.NET Membership provider for security. However when I run the following command (of course replacing [sql server] and such with proper information) I get a pretty big error.


aspnet_regsql -S [my computer name]\[sql server] -E -A all -d DotWiki

I get the following error when I run this.

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regsql -S AGQAOFFICE\SQLSER
VER05 -E -A all -d DotWiki

Start adding the following features:
Membership
Profile
RoleManager
Personalization
SqlWebEventProvider

.
An error occurred during the execution of the SQL file 'InstallMembership.sql'.
The SQL error number is 290 and the SqlException message is: Invalid EXECUTE sta
tement using object "Relation", method "SetUseVarDecimal".
SQL Server: [my computer name]\[sql server]
Database: [DotWiki]
SQL file loaded:
InstallMembership.sql

Commands failed:

/*************************************************************/
/*************************************************************/
/*************************************************************/

DECLARE @ver int
DECLARE @version nchar(100)
DECLARE @dot int
DECLARE @hyphen int
DECLARE @SqlToExec nchar(400)

SELECT @ver = 8
SELECT @version = @@Version
SELECT @hyphen  = CHARINDEX(N' - ', @version)
IF (NOT(@hyphen IS NULL) AND @hyphen > 0)
BEGIN
    SELECT @hyphen = @hyphen + 3
    SELECT @dot    = CHARINDEX(N'.', @version, @hyphen)
    IF (NOT(@dot IS NULL) AND @dot > @hyphen)
    BEGIN
        SELECT @version = SUBSTRING(@version, @hyphen, @dot - @hyphen)
        SELECT @ver     = CONVERT(int, @version)
    END
END

/*************************************************************/

IF (@ver >= 8)
    EXEC sp_tableoption N'aspnet_Membership', 'text in row', 3000

/*************************************************************/
/*************************************************************/

IF (EXISTS (SELECT name
              FROM sysobjects
             WHERE (name = N'aspnet_Membership_CreateUser')
               AND (type = 'P')))
DROP PROCEDURE dbo.aspnet_Membership_CreateUser

SQL Exception:
System.Data.SqlClient.SqlException: Invalid EXECUTE statement using object "Rela
tion", method "SetUseVarDecimal".
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea
n breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception
, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj
ect stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cm
dHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, Tds
ParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName,
Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult res
ult, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at System.Web.Management.SqlServices.ExecuteFile(String file, String server,
String database, String dbFileName, SqlConnection connection, Boolean sessionSta
te, Boolean isInstall, SessionStateType sessionStatetype)

Any help would be appreciated 🙂

Best Answer

First of, please install the latest servicepack as splattne suggested, as the @@version you've mentioned is NOT sp2. See http://www.krell-software.com/mssql-builds.asp

Second, you can also install the required tables, sprocs and views directly. You can find scripts to run in SQL server here: %WINDOWS%\Microsoft.NET\Framework\v2.0.50727\

See this page for more information: http://aspnet.4guysfromrolla.com/articles/040506-1.aspx

Related Topic