hello, can anyone help me with this one?
I have made a mysql connection and results display, however i need to create a txt tile for each result, with the result as file name
Example:
mysql query returns "123123123", then file 123123123.txt woud be created.
here is my code as it stands
- string[] filePaths = Directory.GetFiles(@"C:\Users\travi\Desktop\customers\Active");
- foreach (string filePath in filePaths)
- File.Delete(filePath);
- string serverIp = "localhost";
- string username = "root";
- string password = "";
- string databaseName = "teste";
-
- string dbConnectionString = string.Format("server={0};uid={1};pwd={2};database={3};", serverIp, username, password, databaseName);
- string query = "SELECT ID FROM `wp_posts` WHERE `post_type` = 'shop_subscription' and post_status = 'wc-active'";
-
- var conn = new MySql.Data.MySqlClient.MySqlConnection(dbConnectionString);
- conn.Open();
-
- var cmd = new MySql.Data.MySqlClient.MySqlCommand(query, conn);
- var reader = cmd.ExecuteReader();
-
- while (reader.Read())
- {
- var subs = reader["ID"];
-
-
-
-