0

我的场景是,当用户在 CreateUserWizard 中创建完其帐户后,我想将 UserId 的值传递给我数据库中的另一个表。

我正在使用 ASP .Net C#。

我尝试了下面的代码,但出现错误:无法从 'System.Guid' 转换为 'byte[]'

对可能/替代解决方案有什么建议吗?

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);
4

1 回答 1

0

看看这个,它将帮助您更多地了解 asp.net 以及如何存储更多信息

http://www.4guysfromrolla.com/articles/070506-1.aspx

于 2012-03-09T21:39:33.803 回答