Questions tagged [oledbdatareader]

OleDbDataReader Class provides a way of reading a forward-only stream of data rows from a data source.

OleDbDataReader Class provides a way of reading a forward-only stream of data rows from a data source.

System.Object
. System.MarshalByRefObject
. . System.Data.Common.DbDataReader
. . . System.Data.OleDb.OleDbDataReader

Namespace: System.Data.OleDb
Assembly: System.Data (in System.Data.dll)

To create an OleDbDataReader, you must call the ExecuteReader method of the OleDbCommand object, instead of directly using a constructor.

Before you close the OleDbConnection, first close the OleDbDataReader object. You must also close theOleDbDataReader object if you plan to resuse an OleDbCommand object.For example, you cannot retrieve output parameters until after you call Close.

http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbdatareader.aspx

175 questions
2
votes
2 answers

Is it possible to return an OleDbDataReader object from a method?

Is it possible to return an OleDb.OleDbDataReader object from a function? If so how would you go about doing that? My current code returns the data reader object but when I try to read that object I get an error saying…
Oliver Guy
  • 71
  • 8
2
votes
2 answers

Why won't this DataAdapter insert rows into the database?

So I have a situation where I am using a SqlDataAdapter to insert rows into a table in a SQL Server 2014 database. The source of the data is an Excel spreadsheet. The insert works fine when the DataTable object is populated using a few For loops and…
Jacob H
  • 2,455
  • 1
  • 12
  • 29
2
votes
1 answer

Windows indexing search - OleDbException Not Specified Error

I'm getting an exception (OleDBException: Not specified Error) when trying to search in indexed files in a folder on my D-drive (D:\TaalTipsDocumenten). I know this piece of code worked in the past (2 months ago), but when trying to continue working…
Dennis
  • 164
  • 1
  • 9
2
votes
1 answer

Read each row in a single column in a DataReader

I use while(dr.Read()){...}. But I have a problem with reading data. I have a table like this: Column1 value1 value2 value3 I want to get Value1, Value2 and Value3 I did this like so: Using myDataReader As OracleDataReader =…
Emma W.
  • 215
  • 1
  • 6
  • 20
2
votes
1 answer

LIKE Command Problem using OLEDBREADER and MS Access

Odd one this... The following command returns what I would expect when I run it in query window in Access 2003: SELECT * FROM Train WHERE [Days] LIKE '*3*' However when I pass this into my C# code to run (returning an OleDbDataReader) I get…
BIDeveloper
  • 2,628
  • 4
  • 36
  • 51
2
votes
1 answer

reading n-th row in oledbdatareader in c#

I have a excel sheet showing employees salary details in department wise. Just I need to save these details in to MySql . When I use oledbdatareader,it reads from the first row. But I have to choose from different rows. Below im showing sample…
Anu
  • 905
  • 4
  • 23
  • 54
2
votes
1 answer

How to set Access column value to 0 (default) on a new created DB column? C#

So I have read multiple posts about my question but I cant find the right solution for it. I've got a form in which a user can add a custom column to a database. This column is always of type currency with the currency type of Euro. I thought I…
Nicolas
  • 2,277
  • 5
  • 36
  • 82
2
votes
0 answers

Multiple OleDbDataReader on one connection: OK it is working in this situation

I searched the web for multiple OleDbDataReader on one OleDbConnection, but all the answers were negative, however, this code works without error. Why is that? Dim DATA_BASE_Name As String =…
vitcaro
  • 21
  • 2
2
votes
1 answer

OleDbDataReader = null

I'm currently building a program which stores messages between users in a database and returns these messages to the user when the button below gets pressed. I'm using a SQL CE database using a OleDbConnection and using a DataReader. private void…
Leon Winston
  • 141
  • 1
  • 2
  • 9
2
votes
2 answers

LIKE query on an Access database via C# always returns COUNT(*) of 0

Please look into following code: using (OleDbConnection openCon = new OleDbConnection(ConfigurationManager.AppSettings["AccessConnectioString"])) { openCon.Open(); string tc = string.Empty; string ttc…
user3030342
  • 111
  • 1
  • 2
  • 13
2
votes
1 answer

OleDbDataReader does not see data in the cell(.xlsx)

Have a really weird problem with reading xlsx file(I'm using OleDbDataReader). I have a column there that consist of the following data: 50595855 59528522 C_213154 23141411 The problem is that when I read this column the reader shows me that…
IgorShch
  • 149
  • 1
  • 4
  • 21
1
vote
1 answer

Reading users from Access into a list returns only one user

I'm working on a WPF App in C# with VS 2010 SP1. I've looked at quite a few examples on here and elsewhere around the web, and my code seems correct, but when I attempt to read rows from an Access DB into a class then into an ObservableCollection…
Ashton
  • 13
  • 2
1
vote
1 answer

OledbDataReader using up all the RAM (in powershell)

From all my reading, the oledb datareader does not store records in memory, but this code is maxing out the RAM. Its meant to pull data from an Oracle db (about 10M records) and write them to a GZIP file. I have tried everything (including…
neuralgroove
  • 580
  • 4
  • 12
1
vote
1 answer

In VB.Net, why OleDataReader GetDecimal() function returns only integer part?

When I run following code on VB.Net (Visual Studio 2019) a get 789 and never I receive 789.1234. Decimal part il always missing ! Imports System.Data.OleDb Dim cs = "Provider=PostgreSQL OLE DB Provider;" _ & "DataSource=127.0.0.1;" _ …
schlebe
  • 3,387
  • 5
  • 37
  • 50
1
vote
4 answers

How dump database table to excel sheet?

I am getting data from my database and I want to have that data as a table in excel file. So, I have written the following : Dim sheetToPopulate As Excel.Worksheet = getSheet() Dim reader As OleDbDataReader Dim query As String = "SELECT…
Yugal Jindle
  • 44,057
  • 43
  • 129
  • 197
1
2
3
11 12