Advertisement
Guest User

Untitled

a guest
Jun 18th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using MySql.Data;
  6. using MySql.Data.MySqlClient;
  7. using System.Data.SqlClient;
  8. using System.Data;
  9. using System.Collections;
  10.  
  11. namespace accounts
  12. {
  13. class Program
  14. {
  15. static void Main(string[] args)
  16. {
  17.  
  18. //mysql kezdődik itt
  19. Console.WriteLine("--------------------------------------");
  20.  
  21. string MyConString = "SERVER=localhost;" +
  22. "DATABASE=emulator;" +
  23. "UID=root;" +
  24. "PASSWORD=;";
  25. MySqlConnection connection = new MySqlConnection(MyConString);
  26. MySqlCommand command = connection.CreateCommand();
  27. MySqlDataReader Reader;
  28. command.CommandText = "SELECT id,password,mail FROM users";
  29.  
  30. connection.Open();
  31. string MsConString = "Data source=.\\SQLEXPRESS;Database=silkroad;User=sa;Password=1234;";
  32. SqlConnection connection2 = new SqlConnection(MsConString);
  33. SqlCommand command2 = connection2.CreateCommand();
  34. SqlDataReader Reader2;
  35. Reader = command.ExecuteReader();
  36.  
  37. while (Reader.Read())
  38. {
  39.  
  40. string id2 = Reader["id"].ToString();
  41. string pw2 = Reader["password"].ToString();
  42. string mail2 = Reader["mail"].ToString();
  43.  
  44.  
  45.  
  46.  
  47. connection2.Open();
  48. command2.CommandText = "INSERT INTO users (id,password,ban,online,serverid,silk,gold,mail) VALUES ('" + id2 + "','" + pw2 + "','0','0','1905','200','999999','" + mail2 + "') " ;
  49.  
  50. Reader2 = command2.ExecuteReader();
  51. connection2.Close();
  52.  
  53.  
  54. }
  55. connection.Close();
  56.  
  57. }
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement