Advertisement
Guest User

Untitled

a guest
Apr 6th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.09 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15.  
  16. using System.Collections;
  17. using MySql.Data.MySqlClient;
  18.  
  19.  
  20. namespace WpfApp1
  21. {
  22.     /// <summary>
  23.     /// Logika interakcji dla klasy MainWindow.xaml
  24.     /// </summary>
  25.     public partial class MainWindow : Window
  26.     {
  27.  
  28.  
  29.         static MySqlConnection polaczenie = new MySqlConnection("server=skydomesoftware.cba.pl; password=XXX; user=FridgeCook; database=skydome_software;charset=utf8");
  30.         static String ConnectionString = "server=skydomesoftware.cba.pl; password=XXX; user=FridgeCook; database=skydome_software;charset=utf8";
  31.         static MySqlCommand komenda;
  32.         static MySqlDataReader czytnik;
  33.         static string polecenie = "";
  34.      
  35.  
  36.  
  37.  
  38.         public MainWindow()
  39.         {
  40.             InitializeComponent();
  41.  
  42.  
  43.             wypis();
  44.         }
  45.  
  46.       public void wypis()
  47.         {
  48.             //try
  49.             //{
  50.             //    using (MySqlConnection polaczenie = new MySqlConnection(ConnectionString))
  51.             //    {
  52.             //        polaczenie.Open();
  53.             //        polecenie = "select * from " + "CLPKonwersacje" + " where ID = 1 ";
  54.             //        komenda = new MySqlCommand(polecenie, polaczenie);
  55.             //        komenda.ExecuteNonQuery();
  56.             //        czytnik = komenda.ExecuteReader();
  57.  
  58.             //        while (czytnik.Read())
  59.             //        {
  60.             //            Tekst.Text = czytnik["ContentPL1"].ToString();
  61.             //        }  
  62.             //        czytnik.Close();
  63.             //        polaczenie.Close();
  64.             //    }
  65.             //}
  66.             //catch (MySqlException ex)
  67.             //{
  68.             //    Tekst.Text = ex.ToString();
  69.             //}
  70.         }
  71.     }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement