Questions tagged [mysqldatareader]

Reads a forward-only stream of rows from a MySQL database.

Reads a forward-only stream of rows from a MySQL database. To create a MySqlDataReader, you must call the ExecuteReader method of the MySqlCommand object, rather than directly using a constructor.

107 questions
0
votes
1 answer

C# MySql DataTable fill in Array

i got a problem. I want to write a Programm to Insert some stuff into a Mysql Database. In the first time i make for every column in the Database a own String and used this to make the SQL Query. But in the most tables i got more then 100 columns.…
0
votes
1 answer

There is already an open DataReader associated with this Connection which must be closed first?

I am facing the DataReader open connection issue in ASP.NET c# While Reading the records from MySQL database. I do not know how at first time of execution of datareader it showing me open connection. The error as below at DAL MySqlDataReader…
skt
  • 449
  • 14
  • 32
0
votes
0 answers

Looping datareader using For Next VB.NET :There is already an open DataReader associated with this Connection which must be closed first

For x=0 To 2 Dim FO As String Dim DataQuery1 As String DataQuery1 = "Select * from dole_employees WHERE fullname like '%" & Temp_Employees_Name & "%'" mysqlcommand = New MySqlCommand(DataQuery1, mconnection) readme =…
0
votes
1 answer

SubSonic: MySqlDataReader closes connection

I am using SubSonic 2.1 and entcountered a problem while executing a Transaction with SharedDbConnectionScope and TransactionScope. The problem is that in the obj.Save() method I get an "The connection must be valid and open" exception I tracked…
Jürgen Steinblock
  • 30,746
  • 24
  • 119
  • 189
0
votes
0 answers

How to get results one by one 'MySqlDataReader'

using (MySqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { Console.WriteLine(reader.GetString(0)); } } I get few results in same time but i want to get one by one, what i should add?
Xizt
  • 3
  • 1
0
votes
1 answer

c# mysqlreader multithread fail

I'm writing a Database class using c# that interacts with a multithread sdk. I should use only one connection(No need to say!) However, I always get errors about connection and datareaders. Anly help appreciated. Here is the structure of my…
fatih
  • 73
  • 1
  • 13
0
votes
1 answer

C# Loop through DataGridView - MySqlDataReader stops after 2 Rows?

I'am having a hard time with C# ATM... Its about this nasty piece of code here: foreach (DataGridViewRow r in dgv_selectedOrders.Rows) { MessageBox.Show(r.Cells[0].Value.ToString()); order_id =…
0
votes
1 answer

MySqlDataReader not returning data

As part of a project to import data into wordpress via screen scraping I've a database table of old and new URL's stored in a MySQL database. In the example below the ExecuteReader command doesn't appear to be returning any data (-1 rows effected),…
user70568
0
votes
1 answer

Error inserting 100 million record in MYSQL tables

i have table Temp_load with Columns: key bigint(19) UN PK plane_key bigint(20) PK locat_key bigint(20) PK time_period_key bigint(19) UN PK business_unit_key bigint(19) UN curret_allocated tinyint(1) value float valid_ind int(11) last_updated…
0
votes
0 answers

MySqlDataReader error when running the method twice

I have this code. When I execute this once, I am able to get the correct list. But when I run this method again, the reader has no data. I was thinking did I forget to close some connection before calling it again, thus leading to the null result …
user3398315
  • 331
  • 6
  • 17
0
votes
2 answers

How can I get the content of 2 columns and show this?

public void ShowFirstFiveHighScore() { string query = "SELECT 'key', 'PlayerName', 'HighScore' FROM PlayerPoints ORDER BY HighScore DESC LIMIT 5"; if (this.OpenConnection() == true) { MySqlCommand cmd =…
Ramosta
  • 626
  • 1
  • 7
  • 29
0
votes
2 answers

declaring a MySqlDataReader without initialising it

I want to declare a MySqlDataReader, without initialising it or assigning any value to it. Like the code below. MySqlDataReader rdr; try { /* stuff to open the MySqlDataReader and use it, not important for my question */ } catch (Exception e) { /*…
user1644564
  • 385
  • 3
  • 11
0
votes
3 answers

Getting error for Data Reader in vb.net

Im facing the error when execute the data reader command in vb.net. it throw handling. This field like when you enter employee id in textbox then it will capture in database for other field name,department. here is my code Protected Sub…
kolapopo
  • 108
  • 1
  • 4
  • 14
0
votes
0 answers

MySql Connector .NET column not found in join operation

I'am using the official MySql Driver for ADO.NET and I have problems to query my database. With the MySQL Workbench tool on my server, my SQL-Query works without any problems. The Adapter DLL is throwing the following message with the same query:…
Patrik
  • 1,119
  • 5
  • 18
  • 37
0
votes
1 answer

How to make Public MySQLDataReader CLS-Compliant?

I have a project that is CLS-Compliant except one variable declaration which is confusing me how to correct. I have a class called MySQL, summed up it looks like: public class mysql implements idisposable private connection as new…
Jeff
  • 1,609
  • 3
  • 20
  • 25