Access Security Only via Enterprise Server


Author
Message
Derek Price
Derek Price
StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)
Group: Forum Members
Posts: 51, Visits: 376
In our WinForms application, we are using role-based security. I can only save security changes via either the SecurityDialog or UserEditor when connected to our SQL Server 2008 database through Enterprise Server. If I connect to the same database without Enterprise Server it will result in an exception on saving:



MicroFour.StrataFrame.Business.BusinessLayerException: An error occurred while saving an the data to the server. ---> MicroFour.StrataFrame.Data.DataLayerSavingException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.

at MicroFour.StrataFrame.Data.DbDataSourceItem.InternalExecuteReader(DbCommand Command, Boolean IsTransactional, String TransactionKey)

at MicroFour.StrataFrame.Data.SqlDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler, Boolean RecreateCommand)

at MicroFour.StrataFrame.Data.DbDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler)

at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTableThread(Object ThreadParams)

--- End of inner exception stack trace ---

at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTable(DataTable TableToUpdate, Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.Data.DataLayer.SaveByForm(DataTable TableToSave, Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.Business.BusinessLayer.SaveByForm(Boolean Transactional, String TransactionKey)

--- End of inner exception stack trace ---

at MicroFour.StrataFrame.Business.BusinessLayer.SaveByForm(Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save(Boolean Transactional, String TransactionKey)

at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save()

at MicroFour.StrataFrame.Security.UserEditor.cmdSave_Click(Object sender, EventArgs e)

at System.Windows.Forms.Control.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnClick(EventArgs e)

at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ButtonBase.WndProc(Message& m)

at System.Windows.Forms.Button.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)

at System.Windows.Forms.Nativewindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

at System.Windows.Forms.Application.RunDialog(Form form)

at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)

at OHR.SYSTOC.WinForms.FileMain.MD.btnSecurity_Click(Object sender, EventArgs e) in c:\projects\SYSTOC.NET\MAIN\CODE\OHR.SYSTOC.WinForms.FileMain\Md.cs:line 45





We correctly set the key stuff here in Program.cs:



SecurityBasics.SecurityDataSourceKey = MyApp.SecurityDataSourceKey;

SFSPreferencesBO.RetrieveSecurityPreferences();



//-- Set the encryption key and vector for the user data

SecurityBasics.SetSecurityKeyAndVectorForUserAuthentication(MyCompany.MyApp.SecurityKey);





We also data deploy all the SFS* tables to this database in the DDT. Any ideas on why this may be happening?



Thanks,

Derek
Replies
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Hmm...no, that should do it. Did you try to set the break points? This will quickly confirm that you actually have a key as and then if you actually have the data source set. Likely neither of these is the issue, but better to check 'em and know.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Derek, this should be working. So something must be out of sync someplace. There is really nothing different when querying directly or through ES with the exception of the ES data source being update to date. So the next thing I would do here is turn on debugging on the DataSource to see where it is failing. If you are update using CRUD settings (even if your are not) you should be able to see the UPDATE or INSERT statement coming across which may give a clue here.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search