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 { /// /// Логика взаимодействия для SpisokBikes.xaml /// public partial class SpisokBikes : Window { VeloprokatEntities db; public SpisokBikes() { InitializeComponent(); SqlConnection connection = new SqlConnection("server=mssql; Trusted_Connection=YES;DataBase=gr692_kaa;"); connection.Open(); string cmd = "select ID, Company as N'Компания', Model as N'Модель' from Bikes"; SqlCommand createcommand = new SqlCommand(cmd, connection); createcommand.ExecuteNonQuery(); SqlDataAdapter sql = new SqlDataAdapter(createcommand); DataTable dt = new DataTable("Bikes"); sql.Fill(dt); prodinfo.ItemsSource = dt.DefaultView; connection.Close(); } private void Vixod(object sender, RoutedEventArgs e) { MainWindowProd MWP = new MainWindowProd(); MWP.Show(); Close(); } private void Insert(object sender, RoutedEventArgs e) { Insert_Bikes IB = new Insert_Bikes(); IB.Show(); Close(); } } }