Calling MSSQL's aspnet_Membership_CreateUser stored procedure
Tech-Today

Calling MSSQL's aspnet_Membership_CreateUser stored procedure


Here's how you would want to call mssql's aspnet_Membership_CreateUser method:

DECLARE @return_value int,
@UserId uniqueidentifier,
@nowUtc datetime,
@now datetime

set @nowUtc = getutcdate()
set @now = getdate()

EXEC @return_value = [dbo].[aspnet_Membership_CreateUser]
@ApplicationName = N'myApp',
@UserName = N'myUserName',
@Password = N'GnVHaGINqzkX14MAjYFNS8eIj1M=',
@PasswordSalt = N'BdR75cxL6c4sTWaDq+AuVw==',
@Email = N'myEmail',
@PasswordQuestion = N'secretQuestion',
@PasswordAnswer = N'secretAnswer',
@IsApproved = false,
@CurrentTimeUtc = @nowUtc,
@CreateDate = @now,
@UniqueEmail = 1,
@PasswordFormat = 1,
@UserId = @UserId OUTPUT

SELECT @UserId as N'@UserId'

SELECT 'Return Value' = @return_value

GO





- Many To Many Relationship In Entity Framework
An example of many-to-many relationship is asp's membership tables, between aspnet_Users and aspnet_Roles. Usually we declare it like this: public class AspUser { public Guid UserId { get; set; } ... public ICollection AspRoles { get; set; } }...

- Passing An Array Of Objects To Mssql Stored Procedure
Oftentimes you need to pass an array of objects (could be ids, types, etc) in an mssql stored procedure that you either need to insert into a table or use as filter. The following codes will explain the latter: Pass an array of integers: ALTER PROCEDURE...

- Insert An Md5 Password In Mssql
To md5 a string in mssql we execute this query: select HASHBYTES('MD5', 'password') //But this has a problem because it returns a VarBinary data type which is a garbled text. So it should be converted first to NVarchar: SELECT CONVERT(NVARCHAR(32),HashBytes('MD5',...

- Mssql Get The Date From Datetime
...

- -2147219047;solserver.verify_respondinvalid Xml The Name Of The Top Most Element Must Match The Name Of The Doctype Declaration.
I was testing the USPS Api, when I got that error. This is because of the error in my root tag, my request is as follow: API=Verify&XML=<verifyrequest USERID='207BAZLI7194' PASSWORD='053FG85YP581'><address ID="0"> <address1></Address1><address2>Address2</Address2><city>City</City><state>State</State><zip5>Zip...



Tech-Today








.