The reader is always null , I have no idea why.
Before the connection was in one method, everything worked fine.
the code:
private MySqlConnection connection; private MySqlCommand command; private MySqlDataReader Reader; public Form1() { InitializeComponent(); DBint(); } private void DBint() { string myConnectionString = "SERVER=xxx;PORT=3306;" + "DATABASE=xxx;" + "UID=root;" + "PASSWORD=xxx;"; connection = new MySqlConnection(myConnectionString); command = connection.CreateCommand(); MySqlDataReader Reader;
test123123
source share