using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; namespace veloprokat2 { /// /// Логика взаимодействия для Window1.xaml /// public partial class Window1 : Window { public Window1() { InitializeComponent(); SqlConnection connection = new SqlConnection("server=DESKTOP-9UG7OCA; Trusted_Connection=YES;DataBase=Veloprokat;"); connection.Open(); string cmd = "select * from InfoRab"; SqlCommand createcommand = new SqlCommand(cmd, connection); createcommand.ExecuteNonQuery(); SqlDataAdapter sql = new SqlDataAdapter(createcommand); DataTable dt = new DataTable("InfoRab"); sql.Fill(dt); prodinfo.ItemsSource = dt.DefaultView; connection.Close(); } private void Vixod(object sender, RoutedEventArgs e) { MainWindowAdm MWA = new MainWindowAdm(); MWA.Show(); Close(); } private void Insert(object sender, RoutedEventArgs e) { Insert_zap Insert = new Insert_zap(); Insert.Show(); Close(); } } }