How can I use connected mode instead of disconnected?

  • Thread starter Thread starter Brooke
  • Start date Start date
B

Brooke

I would like to bind some datagrids to datasource and have them update the
database when a row is changed. I don't like the disconnected mode. I am
developing a Windows Form app, not an ASP.net app.

Would like to have the same functionality as I did with VB6 and Delphi....

Thanks
 
Use the ADO Recordset through COM InterOp then. ADO.NET doesn't really
provide a mechanism to do what you are looking for. Mostly becuase it is
not as efficient (connected mode) and more dangerous to your data.
 
I guess that I am taking the lazy route. I would like to avoid counting on
the user to click "Save" after editing data on a form or datagrid. All of
our current apps save the record when you change rows.

Also thought that it may reduce the amount of code required for updates,
inserts, deletes, and user concurrency. I need to have this major db app up
and running it less than two weeks, and I calculated that after I create the
data classes, data access classes, stored procedures, and concurrency
checking that I at least a few thousand lines of code to write and debug...

Thanks


Miha Markic said:
What functionality are you looking for?

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Brooke said:
I would like to bind some datagrids to datasource and have them update the
database when a row is changed. I don't like the disconnected mode. I am
developing a Windows Form app, not an ASP.net app.

Would like to have the same functionality as I did with VB6 and
Delphi....

Thanks
 
Brooke said:
I guess that I am taking the lazy route. I would like to avoid counting on
the user to click "Save" after editing data on a form or datagrid. All of
our current apps save the record when you change rows.

I don't think this approach works for any serious application for many
reasons. What about transactions for example?
Anyway, if you really want an automatic save it is no big deal to do it even
in disconnected scenario.
Also thought that it may reduce the amount of code required for updates,
inserts, deletes, and user concurrency. I need to have this major db app
up and running it less than two weeks, and I calculated that after I
create the data classes, data access classes, stored procedures, and
concurrency checking that I at least a few thousand lines of code to write
and debug...

Take a look at OR mappers. Much of the plumbing is done automatically for
you (plus much more)
As usual I recommend LLBLGenPro (www.llblgen.com) - you'll have all the code
mentioned above in 5 minutes.
 
There are lots of scenarios where this is desirable (required) behavior.
There are a number of approaches including adding a timer that checks for
unsaved changes and posts them (and returns server-side changes) and others.
Some are built around server-side cursors so your cached row(s) are simply
key pointers to the actual rows (using a few cached rows in memory). ADO.NET
does not help in the latter case but it's possible to implement ANSI cursors
in any application--managing them is up to you.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

Brooke said:
I guess that I am taking the lazy route. I would like to avoid counting on
the user to click "Save" after editing data on a form or datagrid. All of
our current apps save the record when you change rows.

Also thought that it may reduce the amount of code required for updates,
inserts, deletes, and user concurrency. I need to have this major db app
up and running it less than two weeks, and I calculated that after I
create the data classes, data access classes, stored procedures, and
concurrency checking that I at least a few thousand lines of code to write
and debug...

Thanks


Miha Markic said:
What functionality are you looking for?

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Brooke said:
I would like to bind some datagrids to datasource and have them update
the database when a row is changed. I don't like the disconnected mode.
I am developing a Windows Form app, not an ASP.net app.

Would like to have the same functionality as I did with VB6 and
Delphi....

Thanks
 
Back
Top