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

169 questions
7
votes
2 answers

Is there a way to force Microsoft.Jet.OLEDB to get date Columns in MM/DD/YYYY format from Excel?

I am having a problem with reading DateColumns from an excel sheet. Sometimes people use different date Formats and this brings a problem. Let's say when I expect 07/26/2010 from an Excel column I get 26-Jul-2010 because the user has changed its…
pencilCake
  • 45,443
  • 73
  • 211
  • 346
7
votes
3 answers

How Does GetSchemaTable() Work?

OleDbDataReader oleDbDataReader = oleDbCommand.ExecuteReader(CommandBehavior.KeyInfo); DataTable dataTable = oleDbDataReader.GetSchemaTable(); How does GetSchemaTable() work? Where does it get its information in RDBMS?
user366312
  • 17,582
  • 55
  • 198
  • 392
6
votes
3 answers

Get retrived records count from OleDbDataReader in C#?

I want to get the retrived records count from the OleDbDataReader in C# ? strQuery = "SELECT * FROM Table_Name" ; dbCommand = new OleDbCommand(strQuery, dbConnection); dbReader = dbCommand.ExecuteReader(); //Now how to…
user662285
  • 3,436
  • 22
  • 68
  • 100
5
votes
2 answers

An OLE DB Provider was not specified in the ConnectionString. 'Provider=SQLOLEDB;

i trying to run query using C#, i am getting the following problem An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB; my code string strConString =…
Noora
  • 299
  • 3
  • 10
  • 25
4
votes
2 answers

When using OleDBDataReader to select a memo field from an Access database it only returns part of the string. How can I get the whole string?

This is my code: OleDbConnection connection = new OleDbConnection( "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\\Offline.accdb;Persist Security Info=False"); connection.Open(); OleDbCommand command =…
Stephen Oberauer
  • 4,898
  • 5
  • 48
  • 72
4
votes
1 answer

OleDbDataReader skips first record

I have the following code : OleDbDataReader xlsReader = new OleDbCommand("Select * from [" +spreadSheetName + "]", xlsFileConnection). ExecuteReader(); In the spreadSheetName parameter i keep my file name. The connection…
Vladislav Furdak
  • 1,485
  • 1
  • 17
  • 40
4
votes
1 answer

OleDbException (0x80004005): Unknown

I have the following code (part of a Windows Form) which connects to an Excel file successfully on my machine, but on a different box it fails. var fd = new OpenFileDialog(); if (fd.ShowDialog() == DialogResult.OK) { var extendedProperties =…
Ryan Gates
  • 4,352
  • 4
  • 46
  • 84
3
votes
1 answer

Oledb data reader reading the deleted rows in an excel document

I'm using the OLEDB Connection to reading an excel document, that document has data up to 100 rows. but when i delete 5 rows then try to read the document again, that OLEDB reader reading up to 100 rows not 95. then throws an exception. I'm…
Arooran
  • 607
  • 1
  • 17
  • 29
3
votes
2 answers

C# How to eliminate duplicate values from comboBox?

I would like to eliminate duplicates from OleDbDataReader Should be easy but I'm spinning my wheels. Any help would be appreciated! private void Database_Load(object sender, EventArgs e) { try { …
NOGRP90
  • 49
  • 2
  • 10
3
votes
1 answer

How to make OleDb code run asynchronous?

I've seen a lot of examples for asynchronous when trying to do Web downloading/reading. But I fail to find a sample or anything for OleDb (or is there a better equivalent?), I'd like to use the new and simplified Async and Await features of C#…
Arndroid
  • 186
  • 1
  • 12
3
votes
1 answer

reading Html file through OLEDB fails

i am trying to read html file through OLEDB reader using following code DataTable dTable; string strDataSource = ""; string strDBFile = ""; long intPos = 0; strDataSource = mstrFilePath; dTable = new DataTable(); mCon = new…
Rajeev Kumar
  • 4,567
  • 4
  • 41
  • 80
3
votes
1 answer

OleDB only returning DbNull, what have I done wrong?

I've got the following code: // personCount = 7291; correct value int personCount = (int)new OleDbCommand("SELECT COUNT(*) AS [count] FROM [Individual]", _access).ExecuteScalar(); List people = new List(); OleDbCommand personQuery =…
Matthew Scharley
  • 115,776
  • 51
  • 189
  • 215
2
votes
2 answers

Sequence is not consecutive

From my previous question I have solved how to display information from MS Access DB file. The problem is that the sequence number is messing up after I have deleted some entries which I used as sample tries, and now the ID of items are out of…
HelpNeeder
  • 5,933
  • 21
  • 80
  • 141
2
votes
5 answers

How to sort 30Million csv records in Powershell

I am using oledbconnection to sort the first column of csv file. Oledb connection is executed up to 9 million records within 6 min duration successfully. But when am executing 10 million records, getting following alert message. Exception calling…
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
  • 31
  • 5
1
2 3
11 12