读者总是null
,我不明白为什么.
在使用一种方法连接之前,一切正常.
码:
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;//error occures her
connection.Open();
Reader = command.ExecuteReader();
//MessageBox.Show(tmp);
//connection.Close();
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
35684 次 |
最近记录: |