I modified my code to:
Dim oSharedConfig As SharedConfig = SharedConfig.Instance
Dim sListName As String = oSharedConfig.oWebPartsOpt.UserOpt.AccountVerificationList.Name
Dim oSPSite As SPSite = SPContext.Current.Site
Dim oSPWeb = SPContext.Current.Web
Using oElevatedSPSite As SPSite = New SPSite(oSPSite.ID)
Using oElevatedSPWeb As SPWeb = oElevatedSPSite.OpenWeb(oSPWeb.ID)
Dim oUserAccStatusList As SPList = oElevatedSPWeb.Lists(sListName)
oUserAccStatusList.Items.Add()
Dim oSPListItem As SPListItem = oUserAccStatusList.Items.Add()
oSPListItem("One") = _sUserLogin
oSPListItem("Two") = _sUserGuid
oSPListItem("Three") = False
oSPListItem("Four") = DateTime.Now
oSPListItem.Update()
End Using
End Using
and right now I'm getting error like this:
Server Error in '/' Application.
Proces sprawdzania poprawności zabezpieczeń tej strony jest nieprawidłowy. Kliknij przycisk Wstecz w przeglądarce, odśwież stronę i ponów operację.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Proces sprawdzania poprawności zabezpieczeń tej strony jest nieprawidłowy. Kliknij przycisk Wstecz w przeglądarce, odśwież stronę i ponów operację.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[COMException (0x8102006d): Proces sprawdzania poprawności zabezpieczeń tej strony jest nieprawidłowy. Kliknij przycisk Wstecz w przeglądarce, odśwież stronę i ponów operację.]
Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish) +0
Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish) +203
[SPException: Proces sprawdzania poprawności zabezpieczeń tej strony jest nieprawidłowy. Kliknij przycisk Wstecz w przeglądarce, odśwież stronę i ponów operację.]
Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish) +251
Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean suppressAfterEvents) +1026
Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents) +182
Microsoft.SharePoint.SPListItem.Update() +94
OurHealthSharedLibrary.OurHealth.User.AddUserAccountDataToSPList() +774
Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state) +70
Microsoft.SharePoint.<>c_DisplayClass4.b_2() +389
Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) +152
Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) +344
Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) +86
OurHealthSharedLibrary.OurHealth.User.AddUserAccountData() +67
ActivateAccountWebPart.OurHealth.ActivateAccount.RegisterUserAccount(String sUserLogin) +75
CreateAccountWebPart.OurHealth.CreateAccountWebPart.SubmitButtonClick(Object sender, EventArgs e) +1780
CustomControls.OurHealth.Register._cSubmitButton_Click(Object sender, EventArgs e) +103
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016