Top "Sqldatareader" questions

Provides a way of reading a forward-only stream of rows from a SQL Server database.

Using SQLDataReader instead of recordset

I am new to this and had this question. Can I use SQLDataReader instead of a Recordset. I want to …

vb.net adodb sqldatareader
convert from SqlDataReader to JSON

public string toJSON(SqlDataReader o) { StringBuilder s = new StringBuilder(); s.Append("["); if (o.HasRows) while (o.Read()) s.Append("{" + '"…

c# json sqldatareader
Multiples Table in DataReader

I normally use DataSet because It is very flexible. Recently I am assigned code optimization task , To reduce hits to …

c# asp.net .net sqldatareader datareader
SqlDataReader Get Value By Column Name (Not Ordinal Number)

Using the methods of the SqlDataReader, I can get the value of a column by passing in it's ordinal, such …

c# sqldatareader
SqlDataReader vs SqlDataAdapter: which one has the better performance for returning a DataTable?

I want to know which one has the better performance for returning a DataTable. Here for SqlDataReader I use DataTable.…

c# performance datatable sqldatareader sqldataadapter
How to (efficiently) convert (cast?) a SqlDataReader field to its corresponding c# type?

First, let me explain the current situation: I'm reading records from a database and putting them in an object for …

c# casting sqldatareader
ExecuteReader requires an open and available Connection. The connection's current state is closed

Ok, I asked about this very error earlier this week and had some very helpful answers and without doubt things …

sql sqldatareader sqlconnection
How to efficiently write to file from SQL datareader in c#?

I have a remote sql connection in C# that needs to execute a query and save its results to the …

c# sqldatareader writetofile
How to read multiple resultset from SqlDataReader?

I have a SP from that I am trying to return 2 result set from, and in my .cs file i …

c# .net sqldatareader multiple-resultsets
Should I call SqlDataReader.HasRows if I am calling SqlReader.Read

Trying to see if it is beneficial to add an if (dr.HasRows) before the while (dr.read()) function. I …

c# sql .net methods sqldatareader