Search code examples
c#asp.net.netuserid

Passing UserId value to another table after Sign Up


My scenario is, when the user is finished creating its account in the CreateUserWizard I want to pass the value of UserId to another table in my database.

I'm using ASP .Net C#.

I've tried the code below but there is an error: cannot convert from 'System.Guid' to 'byte[]'

Any suggestions for a possible/alternate solutions?

MembershipUser currentUser = Membership.GetUser();

Guid currentUserId;
currentUserId = new Guid("{" + currentUser.ProviderUserKey.ToString()+ "}");
MyDataSetTableAdapters.MEMBERINFOTableAdapter accUpdate = new Project1.PAGES.MyTableAdapters.MEMBERINFOTableAdapter();
accUpdate.UpdateQuery(instName, accountMade, lblTodaysDate, currentUserId, instName);

Solution

  • Take a look at this it will help you understand more about asp.net and how to store more infomation

    https://web.archive.org/web/20211020103243/https://www.4guysfromrolla.com/articles/070506-1.aspx