Questions tagged [idatareader]

IDataReader is a Microsoft .NET interface which can be used to read data coming from a database. Use this tag for questions about using this interface.

Provides a means of reading one or more forward-only streams of result sets obtained by executing a command at a data source, and is implemented by .NET Framework data providers that access relational databases.

References:

Related questions/examples:

Also see .

120 questions
0
votes
2 answers

If row doesn't exist in datareader

The data reader named eventreader can be empty and i'm trying to work out an appropriate statement to detect if the datareader contains rows and if the require record exists. oledbexecute("SELECT [Unit No] FROM UnitOpenAtEvent WHERE [Event ID]='" +…
Peter Roche
  • 335
  • 2
  • 6
  • 18
0
votes
1 answer

idatareader problem

why My idatareader make error .....? byteSize = _reader.GetBytes(_reader.GetOrdinal(sFieldName), 0, null, 0, 0); I want to retrive image from database here sFieldName is database column Name......it show me Specified cast is not valid. message…
Shamim
  • 359
  • 4
  • 12
  • 25
0
votes
1 answer

In Subsonic 2.1 how do I get a strongly typed object from find?

In Subsonic 2.1 how do I get type T from Find? Animal criteria = new Animal(); IDataReader result = Animal.Find(criteria); I want result to be of type Animal not IDataReader. How can I convert IDataReader to Animal? I hope there is…
David Silva Smith
  • 11,498
  • 11
  • 67
  • 91
0
votes
2 answers

Memory leak OracleConnection with Oracle Data Access (ODP) in VB.Net, but not C#

Why does the code below cause a memory leak when executed? The error only happens when I use Microsoft Visual Studio 2005 or 2008 in vb.net language. If I use C # is, there is no problem. Dim strCon As String = "data source=SRV-10G;user…
0
votes
1 answer

How to select n rows using IDataReader

[ASP .Net - Microsoft Visual Web Developer 2010] Hi all, I've problem with this code: With MenuNavCatDataSource Dim xReader As Data.IDataReader = .Select(DataSourceSelectArguments.Empty) If xReader.Read Then MenuNavCat1.Text =…
mrjimoy_05
  • 3,452
  • 9
  • 58
  • 95
0
votes
1 answer

moq returning dataReader

I'm having a strange experience with moq/mocking. Im trying to mock the data going into a method so that i dont have to have adatabase available at test time. So im loading in some data ive previously seralised. Loading it into a dataTable, then…
S Rosam
  • 375
  • 1
  • 3
  • 16
0
votes
0 answers

GetSchemaTable Columns Missing?

I am using this code to get data from a dataReader into a DataTable which can then be serialised. However, it looks like any column with a null value isnt being written to the xml. I cant see the issue. This is my entire class, and im calling this…
S Rosam
  • 375
  • 1
  • 3
  • 16
0
votes
1 answer

Stored Procedure in Oracle and IDataReader.Read() in VB.NET

I have a Stored Procedure that seems to be very slow. Executing it in Oracle SQL Developer; SET TIMING ON; DECLARE CUR_OUT UTILS.T_CURSOR; P_ARTTYID NUMBER; P_ORDERST VARCHAR2(200); P_DRUMNO VARCHAR2(200); P_SHIPPINGNO VARCHAR2(200); …
Stefan
  • 5,644
  • 4
  • 24
  • 31
0
votes
1 answer

C# Error : Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource

I update my project Microsoft.Practices.EnterpriseLibrary.Data.dll version 4.0.0.0 to 5.0.414.0. Then I got this error. Previously it worked without issue. Data source is an invalid type. It must be either an IListSource, IEnumerable, or…
delma wax
  • 13
  • 2
0
votes
1 answer

Error when binding repeater with IDataReader after converting asp.net 3.5 to 4.0

I am trying to migrate asp.net 3.5 application to asp.net 4.0 version. asp.net 3.5 is working without any issues, after migrating to asp.net 4.0 getting the below error "An invalid data source is being used for rptStudents. A valid data source…
kiran
  • 1
  • 1
0
votes
1 answer

C# IDataReader System.IndexOutOfRangeException Problem

I encountered IndexOutOfRangeException issue when using IDataReader in C#. Below are my sample code. The code thrown me the Exception when it executed the functions of GetDataValue. public List SelectUsersbyUsernamePassword(string username,…
RogerSK
  • 393
  • 1
  • 18
0
votes
1 answer

How do I read a null value in the IDataReader?

I'm using sqlite as a database. One of the value is null in my database. It's datatype is bytes. Following is the code that I use to retrieve the value, byte[] blobValue = new byte[iData.GetBytes(4,0,null,0,int.MaxValue)-1]; Unfortunately…
user1241241
  • 664
  • 5
  • 20
0
votes
2 answers

sql stored procedure - Having problems retreiving multiple rows of data with Idatareader

I have a stored procedure that does this: SELECT TOP 4 FROM dbo.test (table contains 5 rows) My c# code is: IDataReader test= ((IDataReader)(DataProvider.Instance().ExecuteReader("fetchtest"))); test.Read(); title1.Text = test.GetString(0); …
tdjfdjdj
  • 2,391
  • 13
  • 44
  • 71
0
votes
0 answers

How to get a list of IDataRecord from IDataReader returned by Snowflake .net client?

If we use Microsoft SQL Database, then we get SQLDataReader object when ExecuteReader() function is executed. So we have a function for converting SQLDataReader object into List of IDataRecord which can be used later on when the connection is…
0
votes
1 answer

The specified conversion is not valid. Is IDataReader buggy? Or what am I doing wrong?

Take a look at the image. You will see I retrieve a boolean value from the IDataReader. But calling IdataReader..GetBoolean() throws that error: The specified conversion is not valid. While Convert.ToBoolean(drDatosDco.GetValue(6)) works fine. at…
user3502626
  • 838
  • 11
  • 34