Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql> select Price from rates order by id;
- +-------+
- | Price |
- +-------+
- | 100 |
- | 120 |
- | 150 |
- | 200 |
- | 350 |
- | 700 |
- | 500 |
- | 700 |
- | 800 |
- | 1300 |
- | 1500 |
- | 7000 |
- | 8000 |
- | 15000 |
- | 20000 |
- +-------+
- 15 rows in set
- public List<string[]> ExecuteQuery(string command)
- {
- com = new MySqlCommand(command, con);
- reader = com.ExecuteReader();
- if (reader.HasRows)
- {
- List<string[]> records = new List<string[]>();
- while (reader.Read())
- {
- string[] row = new string[reader.FieldCount];
- for (int i = 0; i < reader.RecordsAffected; i++)
- row[i] = reader[i].ToString();
- records.Add(row);
- }
- reader.Close();
- return records;
- }
- else
- {
- reader.Close();
- return new List<string[]>();
- }
- }
- MySqlCommand com = new MySqlCommand("select Access from useraccounts where Username = '" + tbxUsername.Text + "' and Pass = '" + tbxPassword.Text + ''', d.con);
- object result = com.ExecuteScalar();
Add Comment
Please, Sign In to add comment