Hi

1. I am filling the dataset in my form load method as;

Me.MyTableAdapter.Fill(Me.MyDataSet.Clients).

What about the records that other users add to the database? Do I need to
run the fill command from time to time or will dotnet automatically fetch
these records periodically?

2. I am saving the data as below;

Me.Validate()
Me.MyBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.MyDataSet)

How will system react when concurrency violation occurs? How will system
inform me of it and how can I handle that?

Thanks

Regards

Re: Dataset questions, vs2008 by Miha

Miha
Sun Dec 16 10:58:07 PST 2007


"John" <John@nospam.infovis.co.uk> wrote in message
news:OFvFMsAQIHA.1188@TK2MSFTNGP04.phx.gbl...
> Hi
>
> 1. I am filling the dataset in my form load method as;
>
> Me.MyTableAdapter.Fill(Me.MyDataSet.Clients).
>
> What about the records that other users add to the database? Do I need to
> run the fill command from time to time or will dotnet automatically fetch
> these records periodically?

No, ado.net won't do anything by default. So, either you do fetch from time
to time or use SQL Server's notification services.

>
> 2. I am saving the data as below;
>
> Me.Validate()
> Me.MyBindingSource.EndEdit()
> Me.TableAdapterManager.UpdateAll(Me.MyDataSet)
>
> How will system react when concurrency violation occurs? How will system
> inform me of it and how can I handle that?

You might check "Optimistic Concurrency (ADO.NET)" help topic. Basically it
will tell you that an error happened (or not) in DataAdapter.RowUpdated
event.

--
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/


Re: Dataset questions, vs2008 by William

William
Sun Dec 16 12:09:29 PST 2007

Miha is right. ADO.NET is simply an interface to the data--if you want to
refresh the contents from the server, you must requery. Notification
Services is really a very drastic move though. Another approach not easily
implemented by ADO.NET is a "server-side" cursor. In this case you can
create a "window" on the selected rows and when you position to a specific
row, the interface fetches the current contents of that row--and just that
row. I describe this in detail in my latest book. This is called an "ANSI
Cursor".

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
"John" <John@nospam.infovis.co.uk> wrote in message
news:OFvFMsAQIHA.1188@TK2MSFTNGP04.phx.gbl...
> Hi
>
> 1. I am filling the dataset in my form load method as;
>
> Me.MyTableAdapter.Fill(Me.MyDataSet.Clients).
>
> What about the records that other users add to the database? Do I need to
> run the fill command from time to time or will dotnet automatically fetch
> these records periodically?
>
> 2. I am saving the data as below;
>
> Me.Validate()
> Me.MyBindingSource.EndEdit()
> Me.TableAdapterManager.UpdateAll(Me.MyDataSet)
>
> How will system react when concurrency violation occurs? How will system
> inform me of it and how can I handle that?
>
> Thanks
>
> Regards
>