Questions tagged [datareader]

A DataReader reads a forward-only stream of rows from a data source.

A DataReader reads a forward-only stream of rows from a data source. This tag is for questions about creating or using a datareader in code.

782 questions
5
votes
1 answer

Python Datareader Stock Exchange markets options

I'm using Datareader to get some stock quotes from Yahoo finance. I would like to get the values of Euronext Paris Stock exchange market and not the standard values (NYSE ones I think). import pandas.io.data as web import time today =…
MFK
  • 51
  • 1
  • 2
5
votes
1 answer

How do I mock the method GetValues() in System.Data.IDataReader?

How do I mock the method GetValues() in System.Data.IDataReader? This method changes the array of objects passed to it, so it can’t simply return a mocked value. private void UpdateItemPropertyValuesFromReader( object item, IDataReader reader ) { …
D3vtr0n
  • 2,774
  • 3
  • 33
  • 53
5
votes
2 answers

How can I grant datareader to a sql role?

Is it possible to grant the datareader privileges to a SQL Server Database Role rather than a User?
Rory
  • 40,559
  • 52
  • 175
  • 261
5
votes
2 answers

C# How can I get each column type and length and then use the lenght to padright to get the spaces at the end of each field

I have a console application that extracts data from a SQL table to a flat file. How can I get each column type and length and then use the lenght of each column to padright(length) to get the spaces at the end of each field. Here is what I have…
svon
  • 335
  • 1
  • 7
  • 14
5
votes
3 answers

How to know if a table exists in an Access Database in an OleDb connection

I'm using the below code to connect to an Access Database using OleDb connection in C# .Net How can I know if the table that I have hard-coded into the program actually exists in the file, so that I can show the user the appropriate message? try { …
Vahid
  • 5,144
  • 13
  • 70
  • 146
5
votes
4 answers

C# object creation from datatable

I'm just getting my head round C#. I've been creating classes and objects so say i created a class called Member: public class Member { public int MemberID; public string FirstName; public string LastName; public string…
iamjonesy
  • 24,732
  • 40
  • 139
  • 206
5
votes
3 answers

Close reader before closing connection

Should you always close a DataReader before closing the connection, or is it okay to just close the connection? By just closing the connection does that effectively close the reader? (This is for c#.net 3.5) Thanks!
Dan H
  • 1,828
  • 2
  • 21
  • 38
5
votes
2 answers

Windows Store App StreamSoket DataReader.LoadAsync() ObjectDisposedException

I have problems with Windows 8 UI application. I'm using client-server communication and client needs to check new messages all time. So I use such code, where _socket is a StreamSoket: private async static void MessageReceiver() { …
Dmitriy Bondarchuk
  • 111
  • 1
  • 2
  • 9
4
votes
5 answers

Stored proc Output parameter + Select not passing back output parameter

I have a stored procedure that returns two recordsets which i call using GetReader. I iterate the first, call IDataReader.NextResult(), then iterate the second. I assign values to output parameters in the sp, but when i check the values after…
Al
4
votes
2 answers

pandas_datareader.yahoo.daily not working suddenly

One week ago, I ran the following code and did not get an error. import datetime as dt import pandas_datareader.yahoo.daily as yd df1 = yd.YahooDailyReader("SPY", interval='d', start=dt.date(2022,7,1),end=dt.date.today()).read() However, when I…
Laurence Lam
  • 41
  • 1
  • 3
4
votes
2 answers

VB.NET - Multiple Result Sets in one query?

I have a stored procedure: CREATE PROCEDURE [TestProc] AS BEGIN select '1a', '1b' select '2a', '2b', '2c' select '3a', '3b' END If I execute the following query using SQL Management Studio, exec TestProc I get 3 result sets: 1. | 1a | 1b…
kazinix
  • 28,987
  • 33
  • 107
  • 157
4
votes
3 answers

DataReader returns no rows -- rows are present in database

Okay world, I'm having some trouble. No, this is not 'homework' I've got some code which needs to do two things: 1) Read a list of artists from a database 2) Find all tracks written by that artist and store it for later What I'm doing: 1) SELECT…
A_witty_alias
  • 43
  • 1
  • 4
4
votes
1 answer

DataReader + MySql Connector + Dispose

the problem i have manifests it self only on the latest version of MySQL Connector .Net (6.10 at this date) For ages i have the following working correctly in Both MSSQL and MYSQL: Create DbConnection Create DbCommand using previous…
MaxSantos
  • 156
  • 5
4
votes
3 answers

How to 'select' the current identity value for a table?

dbcc checkident (MyTable, NORESEED) Will show the identity value in a message. I can't see the message as I need to select the identity value through a DataReader. Anyone any ideas? Thanks folks
Binary Worrier
  • 50,774
  • 20
  • 136
  • 184
4
votes
3 answers

C# DataReader: Sql Batch Of Commands And Return Results

When I have multiple select statements that are seperated with an insert statement or some other statement that doesn't return a dataset the last datasets are not returned by the DataReader when calling NextResult. For instance i have the following…
weeksdev
  • 4,265
  • 21
  • 36