Re: SqlCeResultSet: catching events
- From: "Stanislaw Tristan" <admin@xxxxxxxxxx>
- Date: Tue, 20 Jun 2006 12:24:41 +0300
Hello, Ginny, again!
I'm a software architect of future powerful project in sphere of real
estate. Shortly the project has next requirements:
1.. One Central Data Storage that:
1.1 Has own data
1.2 Collects data from our clients
1.3 Publishes all this data at web-portal
2.. Many (unlimited) Local Data Storages in the remote offices of our
clients:
2.1 Any of this offices can have an Administrator and Users
2.2 The Local Data Storage can be accessed for data and managed ONLY from
our shipped application and we must programmatically RESTRICT all types of
access to this storage from other 3rd party applications including built-in
from Microsoft (including protection from Administrator), so primary
requirement for this - whole database encryption and connection string
encryption support of backend database (Local Data Storage). This is also
optional requirement for Central Data Storage
2.3 1-3-5-10 max PCs on each office
2.4 Each Administrator (and may be Users) will have a certified MiniKey to
access for synchronization with Central Data Storage
2.5 Each User must have a privilege to protect his own data from other
users, including protection from Administrator (Row Level Security (RLS) +
encryption some columns)
2.6 Each User must have a privilege to allow access for some rows to some
users (including users from other offices) and this access rules must be
transparently replicated with Central Data Storage and then with destination
Local Data Storage (RLS + some replication techniques)
3.. Implementing creation of Administrator and User of Local Data Storage
via registering them on Central Data Storage (Internet creation), we need
transparent user management for Central and Local offices (replication
techniques)
This is a very main set of requirements. Now I'm searching the database
candidate for Local Data Storage that supports requirements 2.2 (minimum)
"Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ
× ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ: news:ex4ensAlGHA.4888@xxxxxxxxxxxxxxxxxxxxxxx
Stanislaw,
I agree that sounds like a good idea. I'm doing that in several apps that
have a business object layer that sits between the data access
(SqlCeResultSet) and the GUI. That way you have a buffer between the user
and your data, and that strategy allowed me to easily change from using
CSV files to SQL Mobile as the data backend for one of them You're trying
to use the SqlCeResultSet objects as the business layer, which sounds good
in theory, but it really doesn't abstract away the data backend. What if
you wanted to use SQL Server instead of SQL Server Everywhere at some
point in the future? With a business layer in the middle, you might only
need to change the load and store methods, and business objects can be
data bindable if they implement bindable interfaces.
The Patterns and Practices group at Microsoft has been working on this
problem for a while and now has a CTP available for their Mobile Client
Software Factory:
http://msdn.microsoft.com/practices/default.aspx?pull=/library/en-us/dnpag2/html/mcsflp.asp
In addition to data access, they also address security and a number of
other challenges that you might be interested in.
--
Ginny Caughey
.NET Compact Framework MVP
"Stanislaw Tristan" <admin@xxxxxxxxxx> wrote in message
news:%23gvCpYAlGHA.4828@xxxxxxxxxxxxxxxxxxxxxxx
Problem is that I don't want implement my business logic (BL) at ui
controls level. I want to write some BL-level and then any control that
support binding automatically began supporting the BL
"Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx>
ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:OlmWhX$kGHA.1264@xxxxxxxxxxxxxxxxxxxxxxx
Stanislaw,
I think since you don't want the user to actually update your data until
you've had a chance to make sure it's a good idea, it might make more
sense to use a buffer for the user's data entry. Alternatively, don't
use automatic data binding and instead handle the Update yourself after
the user clicks a button or whatever. Which controls are you binding
with? Moving to a new record on a DataGrid for example does call EndEdit
automatically with in turn calls Update - not always what you want. But
if you have only text controls, if the user changes the values, then you
have an opportunity to run your business logic before saving.
--
Ginny Caughey
.NET Compact Framework MVP
"Stanislaw Tristan" <admin@xxxxxxxxxx> wrote in message
news:uc1YXk%23kGHA.1204@xxxxxxxxxxxxxxxxxxxxxxx
Also seen.
Conjunction of BindingSource and ResultSet does not solve, for example,
canceling updating row if some of my business logic fails - no event to
do this provided in the BindingSource. Methods .CancelEdit or
.CurrencyManager.CancelEdit does not works...
It sounds to me that you don't really need the resultset to tell you
when these things happen, but instead you need the data binding
mechanism to do so. If you are using the BindingSource control for
your data binding, look at adding event handlers for CurrentChanged,
CurrentItemChanged, ListChanged, etc.
--
Ginny Caughey
.NET Compact Framework MVP
"Stanislaw Tristan" <admin@xxxxxxxxxx> wrote in message
news:uX0apx8kGHA.5036@xxxxxxxxxxxxxxxxxxxxxxx
Thanks, Ginny, for your answers!
But my problem is still
I detailed saw the code generated by studio. I wrote the class, that
inherit the generated class, added overloaded method Update with some
logic. Then I initialise this new class and boung him to datagrid.
But when I update some record in the grid - my new Update method is
not calling - the class updates datasource via his internal method.
I need to write the class that inherits from ResultSet with my own
Add, Update & Delete methods and this methods must automatically
handled bound controls instead of buil-in methods.
"Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx>
ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:%23gez3R7kGHA.4828@xxxxxxxxxxxxxxxxxxxxxxx
Stanislaw,
Look at the code that Visual Studio can generate for typed
resultsets as a guide. To generate a typed resultset, add a new data
source to your project, and follow the wizards to generate a typed
DataSet. Then find the xsd file in the project and right-click to
see Properties. Change the Custom Tool property from
MSDataSetGenerator to MSResultSetGenerator and you will now have
typed resultset classes for each table you selected in the wizard.
You will see in the generated code that there are methods for
AddYourTableNameRecord and DeleteRecord that you can extend or use
within new methods you write yourself. You could also add a method
named something like InsertRecord or SaveChanges that calls
base.Insert or base.Update and also provides the notification code
you want.
HTH,
--
Ginny Caughey
.NET Compact Framework MVP
"Stanislaw Tristan" <admin@xxxxxxxxxx> wrote in message
news:un2mU86kGHA.5036@xxxxxxxxxxxxxxxxxxxxxxx
You can subclass SqlCeResultSet (or use aYes, I tryed to create class that inherits from SqlCeResultSet ,
but this code throws an invalid cast exception:
Dim cmd As New SqlServerCe.SqlCeCommand(Me.MemoEdit1.EditValue,
Me.SqlCeConnection1)
If Me.SqlCeConnection1.State <> ConnectionState.Open Then
Me.SqlCeConnection1.Open()
rs = cmd.ExecuteResultSet(SqlServerCe.ResultSetOptions.Scrollable
Or SqlServerCe.ResultSetOptions.Updatable Or
SqlServerCe.ResultSetOptions.Sensitive)
Dim rs2 As zResultSet = rs ' invalid cast exception
Me.BindingSource1.DataSource = rs
typed resultset) and provide your own behaviors in the methods
that make changes to the database.
--
Ginny Caughey
.NET Compact Framework MVP
"Stanislaw Tristan" <admin@xxxxxxxxxx> wrote in message
news:OKa5rm6kGHA.2052@xxxxxxxxxxxxxxxxxxxxxxx
I need to catch add/update/delete events to provide custom logic
(and availabity to cancel this operations). But SqlCeResultSet
does not provide any event. How can I implement this behavior
myself?
.
- References:
- SqlCeResultSet: catching events
- From: Stanislaw Tristan
- Re: SqlCeResultSet: catching events
- From: Ginny Caughey [MVP]
- Re: SqlCeResultSet: catching events
- From: Stanislaw Tristan
- Re: SqlCeResultSet: catching events
- From: Ginny Caughey [MVP]
- Re: SqlCeResultSet: catching events
- From: Stanislaw Tristan
- Re: SqlCeResultSet: catching events
- From: Ginny Caughey [MVP]
- Re: SqlCeResultSet: catching events
- From: Stanislaw Tristan
- Re: SqlCeResultSet: catching events
- From: Ginny Caughey [MVP]
- Re: SqlCeResultSet: catching events
- From: Stanislaw Tristan
- Re: SqlCeResultSet: catching events
- From: Ginny Caughey [MVP]
- SqlCeResultSet: catching events
- Prev by Date: Re: Encryption question
- Next by Date: Re: Encryption question
- Previous by thread: Re: SqlCeResultSet: catching events
- Next by thread: HELP! confused with sqlce,csv files and vb.net
- Index(es):