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

Read the contents of a column several times with Mysql datareader

I am creating a console application that outputs the contents of the "password" column and the "username" column. Does anyone know how I could rewrite the output every time new data appears on the password and username rows? I had thought about…
0
votes
1 answer

SqlBulkCopy, MySqlDataReader, BLOB, and IndexOutOfRangeException

So, I am hitting infamous IndexOutOfRangeException when using MySqlDataReader with BLOB columns. My situation is quite specific though. The story is following. I am pulling data from MySQL into SQL Server via first getting MySqlDataReader from…
Oleksandr
  • 292
  • 1
  • 4
  • 15
0
votes
1 answer

Getting Exception Input String was not in a correct format

I am building a windows service with ASP.NET C#. I am trying to make a call from a MySQl database using MySqlCommand object. I try to retrieve data from a table called tbl_patient in my database. When I pass the following query to my MySQlCommand…
0
votes
1 answer

Converting XLS to PDF: Getting "Data index must be a valid index in the field" exception during GetBytes()

I have an application that converts files into PDF. It first saves a blob from MySQL into a temp file and then it converts that temp file into a PDF. I'm getting this "Data index must be a valid index in the field" exception error at the GetBytes()…
E. Choi
  • 1,575
  • 3
  • 8
  • 8
0
votes
1 answer

C# MySQLDataReader returns column names instead of field values

I am using MySQLClient with a local database. I wrote a method which returns a list of data about the user, where I specify the columns I want the data from and it generates the query dynamically. However, the reader is only returning the column…
aidan byrne
  • 524
  • 1
  • 5
  • 11
0
votes
0 answers

c# - PropertyInfo set value List
PropertyInfo set value List show error in convert list I tried to convert to json and I couldn't public class PurchaseBill { public DateTime Date { get; set; } public string Type { get; set; } public string BillType {…
emad
  • 21
  • 4
0
votes
0 answers

Debug version of the code runs 10 times faster compared to released installed app

One of my functions run 10 times slower on the same computer when using the installed release version of the application compared to running the same code in the VS 2107 debug dialog mode. clearly the debug mode does something or pre-load something…
0
votes
1 answer

Populate multiple objects from JSON

I have this code: public class Customer { Int32 id { get; set; } = 0; User user1 { get; set; } = null; User user2 { get; set; } = null; } /* ... */ using (MySqlConnection conn = new MySqlConnection(Costanti.connessione)) { …
Pasto92
  • 21
  • 1
0
votes
2 answers

ASP.NET - GridView empty after page reload

I'm using a MySQL database to store some data, I've got a page in my ASP-project which should show the whole table, when you open up the page as a standard result. Well actually it does, but just one time, if you reload the page or direct to another…
EmbraceMyDuck
  • 183
  • 2
  • 10
0
votes
1 answer

How to show only the items in specific country in listview?

I have a listView that show the user all item that saved in mySql database .. and for User table the user have his Country name .. my question is how I can show the user only item in his Country because I don't want to show him all the item in…
0
votes
1 answer

c# Input string was in incorrect format error when data reading

so this is my problem. this function: public int Reader(string query, string value, int id, int reader) { CloseConnection(); int i = 0; con.Open(); MySqlCommand cmd; cmd = new MySqlCommand(query,…
user9806487
0
votes
1 answer

Else statement fails to work within a while loop

Below is my code to connect to the database using MySqlDataReader. Now the if statement is working fine but the else statement doesnt. When i use the debug function in VS it kept skipping the else statement and jump to the reader.Close();. Any idea.…
epiphany
  • 756
  • 1
  • 11
  • 29
0
votes
0 answers

Difference between Convert.ToBoolean(reader["Name"]) and (bool) (reader["Name"])?

While working on a .Net project and SqlDataReader, came to question about difference between: Convert.ToBoolean(reader["Name"]) And: (bool) (reader["Name"])
Sami
  • 3,686
  • 4
  • 17
  • 28
0
votes
0 answers

Binding ADO DataReader to GridView

Trying to bind the data that I recover from ADO query, I am getting the same error after trying different approach (usaing dataTable, DataView,...). The last one I used is the next: string query = "SELECT * FROM productos"; MySqlConnection con = new…
Kenzo_Gilead
  • 2,187
  • 9
  • 35
  • 60
0
votes
1 answer

Invalid attempt to read when Reader is closed - MySqlDataReader C#

Getting an Invalid attempt to read when Reader is closed exception in my duplicateNameCheck method, when attempting to read from the DataReader. I'm not sure why. Any help is greatly appreciated! public static MySqlConnection GetSqlConnection() { …
kevin
  • 15
  • 1
  • 4