Author: ClarkNK | Posted on: 8/7/2008 12:36:07 PM | Views : 410

I've been hacking around trying to do something I know is pretty simple without success.

MY GOAL: On loading a page, I want to insert a record associated with the logged on user into MyTable. MyTable has primary key UserID which is linked to primary key UserID of another table also.

SETUP: In the page load section, before the code to insert the record I have the code to assign values to a couple of Labels associated with the logged on user:

LblUserIDValue.Text = Membership.GetUser().ProviderUserKey.ToString()

lblUserName.Text = Profile.UserName

The database connection is  "aspnet.mdf connection"  and the insert command I am working with is:

 "INSERT INTO [MyTable] ([FirstName], [UserID]) VALUES (lblUserName.text, LblUserIDValue.Text)  where userID = LblUserIDValue.Text"

QUESTION: Given the above, can some ...

Go to the complete details ...