SqlDatareader & Datatable vs Dataset

  • Thread starter Thread starter ary
  • Start date Start date
A

ary

Hi,
If I use a datatable in conjuction with a sql datareader, would this
still be faster in performance than using a dataset?

If so why?

my Sourcecode like this :
Dim ArticleTable As New Data.DataTable


ArticleTable.Columns.Add("ArticleID",
Type.GetType("System.Int32"))
ArticleTable.Columns.Add("ArticleTitle",
Type.GetType("System.String"))
ArticleTable.Columns.Add("ArticleBody",
Type.GetType("System.String"))
ArticleTable.Columns.Add("ArticleDateCreated",
Type.GetType("System.String"))


..
..
....


Dim reader As SqlDataReader = Command.ExecuteReader()


While reader.Read()


row = ArticleTable.NewRow()


row("ArticleID") = reader("ArticleID")
row("ArticleTitle") = reader("ArticleTitle")
row("ArticleBody") = reader("ArticleBody")
row("ArticleDateCreated") = (reader("ArticleDateCreated"))


ArticleTable.Rows.Add(row)


End While



thanks.
 
You already asked this question, and it was answered several times in the
original thread.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
You already asked this question, and it was answered several times in the
original thread.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:http://www.miradyne.net












- Show quoted text -

You Don't Right My Question Because My Question not correct i correct
it.
 
You already asked this question, and it was answered several times in the
original thread.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:http://www.miradyne.net












- Show quoted text -

You Don't understand Right MY Question Because My Questionwas not
correct, I correct it.

thanks for replay
 
If you want speed up your application, I would rather think about using
custom collections an sqlDataReader.

But before getting into major complexities, Are you having so much
concurrent users that you need to use datareaders? Have you think about using
cache in your application?

HTH
Braulio

/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------
 
Back
Top