ADO.net verbose ?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: ADO.net verbose ?

  1. #1
    c2i - Richard Clark Guest

    ADO.net verbose ?

    I see everywhere that ADO.net is less consumming bandwidth than ADO. It's
    the first reason to more to it.

    Well, OK, why not, but I did some test and it didn't seems really less
    verbose.
    I put an Access base in a computer.
    On my server, I make a DSN connection.
    I Launch Network Monitor.
    Then, I try 2 thing :
    First, reading a ADO Recordset (ForwordOnly) and a ADO.net DataReader -->
    nearly same octets
    Second, always updating 20 records in the database.
    In VB6, code was like this :

    Dim rs As Recordset
    Set rs = New Recordset
    rs.Open "Select * From Personnes", "DSN=BDDFilles", adOpenKeyset,
    adLockOptimistic
    Do Until rs.EOF

    rs.Fields("Temp") = rs.Fields("Temp") & "A"
    rs.Update
    rs.MoveNext
    Loop
    rs.Close
    Set rs = Nothing

    In VB.net, it was :

    Dim oDataSetComm As New ADO.ADODataSetCommand("Select * From Personnes",
    "DSN=BDDFilles")
    Dim ds As New DataSet(), dt As DataTable, dr As DataRow
    oDataSetComm.FillDataSet(ds, "Personnes")
    dt = ds.Tables(0)
    For Each dr In dt.Rows
    dr("Temp") = dr("Temp").ToString & "A"
    Next
    oDataSetComm.Update(ds, "Personnes")
    oDataSetComm.Dispose()

    Results :
    Exchange with ADO are : 240 Ko
    With ADO.net : 600 Ko !!!

    Did I miss something ?


    --
    Richard Clark - rc@c2i.fr
    ______________________________________________
    NOUVEAU : Liste de diffusion sur MS.NET
    Inscription en envoyant un mail :
    ----------------------------------------------
    dotnetfrance-subscribe@yahoogroups.com
    ----------------------------------------------
    http://www.c2i.fr - Le portail francophone
    Visual Basic,VB.NET,ASP, ASP.NET
    + de 517 aides disponibles (15/02)
    ______________________________________________



  2. #2
    Jonathan Allen Guest

    Re: ADO.net verbose ?

    As your question in "Microsoft.Public.Dotnet.Framework.Adonet". You are more
    likely to get the attention of a MS person.

    --
    Jonathan Allen

    "May you always take change in stride and never fear it."

    "c2i - Richard Clark" <rc@c2i.fr> wrote in message
    news:3aa8d6ec@news.devx.com...
    > I see everywhere that ADO.net is less consumming bandwidth than ADO. It's
    > the first reason to more to it.
    >
    > Well, OK, why not, but I did some test and it didn't seems really less
    > verbose.
    > I put an Access base in a computer.
    > On my server, I make a DSN connection.
    > I Launch Network Monitor.
    > Then, I try 2 thing :
    > First, reading a ADO Recordset (ForwordOnly) and a ADO.net DataReader -->
    > nearly same octets
    > Second, always updating 20 records in the database.
    > In VB6, code was like this :
    >
    > Dim rs As Recordset
    > Set rs = New Recordset
    > rs.Open "Select * From Personnes", "DSN=BDDFilles", adOpenKeyset,
    > adLockOptimistic
    > Do Until rs.EOF
    >
    > rs.Fields("Temp") = rs.Fields("Temp") & "A"
    > rs.Update
    > rs.MoveNext
    > Loop
    > rs.Close
    > Set rs = Nothing
    >
    > In VB.net, it was :
    >
    > Dim oDataSetComm As New ADO.ADODataSetCommand("Select * From Personnes",
    > "DSN=BDDFilles")
    > Dim ds As New DataSet(), dt As DataTable, dr As DataRow
    > oDataSetComm.FillDataSet(ds, "Personnes")
    > dt = ds.Tables(0)
    > For Each dr In dt.Rows
    > dr("Temp") = dr("Temp").ToString & "A"
    > Next
    > oDataSetComm.Update(ds, "Personnes")
    > oDataSetComm.Dispose()
    >
    > Results :
    > Exchange with ADO are : 240 Ko
    > With ADO.net : 600 Ko !!!
    >
    > Did I miss something ?
    >
    >
    > --
    > Richard Clark - rc@c2i.fr
    > ______________________________________________
    > NOUVEAU : Liste de diffusion sur MS.NET
    > Inscription en envoyant un mail :
    > ----------------------------------------------
    > dotnetfrance-subscribe@yahoogroups.com
    > ----------------------------------------------
    > http://www.c2i.fr - Le portail francophone
    > Visual Basic,VB.NET,ASP, ASP.NET
    > + de 517 aides disponibles (15/02)
    > ______________________________________________
    >
    >




  3. #3
    c2i - Richard Clark Guest

    Re: ADO.net verbose ?

    Thank's, I'll put it in a second.


    --
    Richard Clark - rc@c2i.fr
    ______________________________________________
    NOUVEAU : Liste de diffusion sur MS.NET
    Inscription en envoyant un mail :
    ----------------------------------------------
    dotnetfrance-subscribe@yahoogroups.com
    ----------------------------------------------
    http://www.c2i.fr - Le portail francophone
    Visual Basic,VB.NET,ASP, ASP.NET
    + de 517 aides disponibles (15/02)
    ______________________________________________

    "Jonathan Allen" <greywolf@cts.com> wrote in message
    news:3aa932c6@news.devx.com...
    > As your question in "Microsoft.Public.Dotnet.Framework.Adonet". You are

    more
    > likely to get the attention of a MS person.
    >
    > --
    > Jonathan Allen
    >
    > "May you always take change in stride and never fear it."
    >
    > "c2i - Richard Clark" <rc@c2i.fr> wrote in message
    > news:3aa8d6ec@news.devx.com...
    > > I see everywhere that ADO.net is less consumming bandwidth than ADO.

    It's
    > > the first reason to more to it.
    > >
    > > Well, OK, why not, but I did some test and it didn't seems really less
    > > verbose.
    > > I put an Access base in a computer.
    > > On my server, I make a DSN connection.
    > > I Launch Network Monitor.
    > > Then, I try 2 thing :
    > > First, reading a ADO Recordset (ForwordOnly) and a ADO.net

    DataReader -->
    > > nearly same octets
    > > Second, always updating 20 records in the database.
    > > In VB6, code was like this :
    > >
    > > Dim rs As Recordset
    > > Set rs = New Recordset
    > > rs.Open "Select * From Personnes", "DSN=BDDFilles", adOpenKeyset,
    > > adLockOptimistic
    > > Do Until rs.EOF
    > >
    > > rs.Fields("Temp") = rs.Fields("Temp") & "A"
    > > rs.Update
    > > rs.MoveNext
    > > Loop
    > > rs.Close
    > > Set rs = Nothing
    > >
    > > In VB.net, it was :
    > >
    > > Dim oDataSetComm As New ADO.ADODataSetCommand("Select * From Personnes",
    > > "DSN=BDDFilles")
    > > Dim ds As New DataSet(), dt As DataTable, dr As DataRow
    > > oDataSetComm.FillDataSet(ds, "Personnes")
    > > dt = ds.Tables(0)
    > > For Each dr In dt.Rows
    > > dr("Temp") = dr("Temp").ToString & "A"
    > > Next
    > > oDataSetComm.Update(ds, "Personnes")
    > > oDataSetComm.Dispose()
    > >
    > > Results :
    > > Exchange with ADO are : 240 Ko
    > > With ADO.net : 600 Ko !!!
    > >
    > > Did I miss something ?
    > >
    > >
    > > --
    > > Richard Clark - rc@c2i.fr
    > > ______________________________________________
    > > NOUVEAU : Liste de diffusion sur MS.NET
    > > Inscription en envoyant un mail :
    > > ----------------------------------------------
    > > dotnetfrance-subscribe@yahoogroups.com
    > > ----------------------------------------------
    > > http://www.c2i.fr - Le portail francophone
    > > Visual Basic,VB.NET,ASP, ASP.NET
    > > + de 517 aides disponibles (15/02)
    > > ______________________________________________
    > >
    > >

    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center