
Okay, I think I figured part of it out:
Protected Sub dvRSVP_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertEventArgs) Handles dvRSVP.ItemInserting
Dim userName As String = User.Identity.Name.ToString
e.Values("userID") = userName
End Sub But now I get a '
Data type mismatch in criteria expression.' error. I'm sure it's the bit above because if I comment it out then the error goes away (but of course userID is blank). This writes to an Access database, the userID field is set to Text there and I can enter the same value manually. Also, the insert parameter seems to be correct:
<asp:Parameter Name="userID" Type="String" />
Any ideas? I'm able to assign the userName to a label and it looks okay. Here's the datasource insert command:
InsertCommand="INSERT INTO [tblRSVP] ([userID], [adults], [kids], [pumpkins], [food]) VALUES (?, ?, ?, ?, ?)"