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
0
votes
1 answer

OleDbDataReader query syntax error in asp.net

i trying to execute a query that link different databases OleDbDataReader, but i am getting error in query string, note that this query is correct and running successfuly in sql studio manager but in .Net i am getting this error in OleDbDataReader…
Noora
  • 319
  • 3
  • 10
  • 26
0
votes
2 answers

How to convert datatype before Importing Excel file to Sql database

Here I have this Import from excel file to sql database class. It was working correctly till now but as my excel file cells are all strings type , So when Importing , the datatype does not match as sql database. How to convert it to their respective…
0
votes
1 answer

Display long Int from access to a text box

I want to fill the text box with the ID of the customer name that has been selected in a combo box. I am getting error under customerID saying Unknown method 'GetInt32(string)'of 'System.Data.Oledb.OledbDataReader' this is the copy of the whole…
Pigeon
  • 117
  • 1
  • 13
0
votes
1 answer

OleDbDataReader not giving same results as SQL Developer

The following query on my oracle db gives results that look fine when run in SQL Developer. select * from guideline$ a left outer join textfragment$ t on (a.TEXTFRAGMENT_CODE = t.TEXTFRAGMENT$_CODE) start with a.knowledge$_Code = 71122 and…
ZWand19
  • 113
  • 1
  • 8
0
votes
2 answers

How can I preempt a "Specified cast is not valid" exception?

In querying an MS Access database in a Web API app, I get a "Specified cast is not valid" exception if I'm trying to assign an empty string to a variable. IOW, when this code: var accountID = oleDbD8aReader.GetInt16(0); var platypusName =…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
0
votes
1 answer

To which C# data type does MS Access "Number" type correspond?

According to http://msdn.microsoft.com/en-us/library/office/aa211091(v=office.11).aspx, the MS Jet database engine has no "NUMBER" data type; yet that is what I see in the MS Access design view of the table that I'm querying - that the data type of…
0
votes
2 answers

Data type mismatch in criteria expression

myConnection.Open() rtb_Address.Clear() txt_Name.Clear() Dim str As String str = "SELECT * FROM table1 WHERE (cus_ID = '" & txt_ID.Text & "')" Dim cmd As OleDbCommand = New OleDbCommand(str, myConnection) dr =…
fatninja
  • 3
  • 5
0
votes
1 answer

ExecuteNonQuery inside of Reader

How can I solve this problem? I do not want to use two connections. ExecuteNonQuery only works if reader is closed. oleCnn = New System.Data.OleDb.OleDbConnection oleCnn.ConnectionString = ConnectionString oleCmm = New…
0
votes
1 answer

I got exception when try to read data from database with the help of OleDb

Hello I am trying to use OleDb to connect database but when i want to read data from there and use Read() command after that cmd.Parameters.Add("@name", TextBox1.Text); cmd.Parameters.Add("@password",…
Alihuseyn
  • 148
  • 1
  • 9
0
votes
1 answer

OleDbDataReader error

I'm trying to save a txt file with Contact numbers of people who have paid but i get an error saying there is an error with "OleDbDataReader dbReader = cmd.ExecuteReader()" saying "Data type mismatch in criteria expression". I think its the…
user1955810
0
votes
0 answers

OleDbDataReader only reads 29,991 of 95,526 records

I'm using an OleDbDataReader, but it only reads 29,991 of 95,526 records: OleDbCommand command = new OleDbCommand("select * from [data$]", connection); using (OleDbDataReader dr = command.ExecuteReader()) { while (dr.Read()) { c++; …
Faisal Sajjad
  • 239
  • 2
  • 4
  • 13
0
votes
2 answers

Input String not in correct format (Format Exception not handled)

I am trying to parse the retried value from the database into double, long, or integer, but it throws a FormatException. I need your help. In this code, I am trying to retrieve hours from the database and sum them to calculate total hours input into…
Abeer Islam
  • 33
  • 1
  • 2
  • 7
0
votes
0 answers

Oracle saving arabic numbers as "??"

Working on Winform based app connecting Oracle via OleDbDatareader, when I save any data having arabic number, for instance: اب۸۴۴ it saves it as اب??? I am using varchar type. It is weird it save non numeric data as it is but entering digits in…
Volatil3
  • 14,253
  • 38
  • 134
  • 263
0
votes
0 answers

OleDdDataReader can't read a particular string "F1"

I have inherited an application written in C# which reads a CSV file and stores the data in database. I've noticed that when a value in the CSV file is this particular string "F1" the application saves it in the DB as "1", omitting the alphabet…
JungleJap
  • 41
  • 1
  • 1
  • 3
0
votes
1 answer

OleDbDataReader gives Unsupported Data Type Error

I am using Oracle Db and calling a Simple Select Query but Oracle is throwing a weird error message: A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll Unspecified error Oracle error occurred, but…
Volatil3
  • 14,253
  • 38
  • 134
  • 263