PC Review


Reply
Thread Tools Rate Thread

Dataset questions, vs2008

 
 
John
Guest
Posts: n/a
 
      16th Dec 2007
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


 
Reply With Quote
 
 
 
 
Miha Markic
Guest
Posts: n/a
 
      16th Dec 2007

"John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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/

 
Reply With Quote
 
William Vaughn
Guest
Posts: n/a
 
      16th Dec 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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How VS2008 DataSet generated works? Marco Castro Microsoft ADO .NET 2 4th Jul 2008 05:04 AM
Dataset class in VS2008 AMP Microsoft C# .NET 1 1st May 2008 03:18 PM
custom column in VS2008 DataSet Cartoper Microsoft ADO .NET 1 19th Dec 2007 04:49 AM
Dataset questions, vs2008 John Microsoft Dot NET Framework Forms 2 16th Dec 2007 08:09 PM
Dataset questions, vs2008 John Microsoft VB .NET 2 16th Dec 2007 08:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:01 AM.