Dataset questions, vs2008

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    #1

    Dataset questions, vs2008

    Hi

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

    Me.MyTableAdapt er.Fill(Me.MyDa taSet.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.MyBindingSou rce.EndEdit()
    Me.TableAdapter Manager.UpdateA ll(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


  • Miha Markic

    #2
    Re: Dataset questions, vs2008


    "John" <John@nospam.in fovis.co.ukwrot e in message
    news:OFvFMsAQIH A.1188@TK2MSFTN GP04.phx.gbl...
    Hi
    >
    1. I am filling the dataset in my form load method as;
    >
    Me.MyTableAdapt er.Fill(Me.MyDa taSet.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.MyBindingSou rce.EndEdit()
    Me.TableAdapter Manager.UpdateA ll(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.Row Updated
    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/

    Comment

    • William Vaughn

      #3
      Re: Dataset questions, vs2008

      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.in fovis.co.ukwrot e in message
      news:OFvFMsAQIH A.1188@TK2MSFTN GP04.phx.gbl...
      Hi
      >
      1. I am filling the dataset in my form load method as;
      >
      Me.MyTableAdapt er.Fill(Me.MyDa taSet.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.MyBindingSou rce.EndEdit()
      Me.TableAdapter Manager.UpdateA ll(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
      >

      Comment

      Working...