p>
і озночает номер стовпчика в таблиці (починається з 0) */
if (tableName == Customers ). Rows. Add (dr. GetValue (0). ToString (). Trim (), dr. GetValue (1). ToString (). Trim ()); if (tableName == Boards ). Rows. Add (dr. GetValue (0). ToString (). Trim (), dr. GetValue (1). ToString (). Trim (), dr. GetValue (2). ToString (). Trim (), dr. GetValue (3). ToString (). Trim (), dr. GetValue (4). ToString (). Trim ()); if (tableName == Productions ). Rows. Add (dr. GetValue (0). ToString (). Trim (), dr. GetValue (1). ToString (). Trim (), dr. GetValue (2). ToString (). Trim (), dr. GetValue (3). ToString (). Trim (), dr. GetValue (4). ToString (). Trim (), dr. GetValue (5). ToString (). Trim ()) ;. Rows. Add (dr. GetValue (0). ToString (). Trim (), dr. GetValue (1). ToString (). Trim (), dr. GetValue (2). ToString (). Trim ()); bind= new Binding () ;. Source=dtTable ;. SetBinding (DataGrid. ItemsSourceProperty, bind);
}. Items. Refresh ();
}. Close () ;. Dispose ();
} void query1_Click (object sender, RoutedEventArgs e)
{x=Interaction. InputBox ( Введіть id співробітника raquo ;, Запит про співробітників raquo ;, raquo ;, 10,10);
SqlConnection conn=new SqlConnection (connStr);
{. Open ();
} (SqlException se)
{. Content=se. Message ;;
} tableName=selectDB. SelectedValue. ToString (); cmd=new SqlCommand ( Select Staff. [First Name], Staff. [Last Name], Productions. Date, Productions. Smena From Staff, Productions +
where Staff. [Staff_id] =id And Staff. [Staff_id]=Productions. Staff_id raquo ;, conn); param=new SqlParameter () ;. ParameterName= @ id raquo ;;. Value=Convert. ToInt32 (x) ;. SqlDbType=SqlDbType. Int ;. Parameters. Add (param); (SqlDataReader dr=cmd. ExecuteReader ())
{dtTable=new DataTable (); (int i=0; i lt; dr. FieldCount; i ++)
{. Columns. Add (dr. GetName (i). ToString (). Trim ());
} (dr. Read ())
{. Rows. Add (dr. GetValue (0). ToString (). Trim (), dr. GetValue (1). ToString (). Trim (), dr. GetValue (2). ToString (). Trim (), dr. GetValue (3). ToString (). Trim ());
} bind=new Binding () ;. Source=dtTable ;. SetBinding (DataGrid. ItemsSourceProperty, bind) ;. Items. Refresh ();
}. Close () ;. Dispose ();
} void query2_Click (object sender, RoutedEventArgs e)
{x=Interaction. InputBox ( Введіть id плати raquo ;, Запит про збірки плат raquo ;, raquo ;, 10,10); conn=new SqlConnection (connStr);
{. Open ();
} (SqlException se)
{. Content=se. Message ;;
} tableName=selectDB. SelectedValue. ToString (); cmd=new SqlCommand ( Select Boards. Name As [Board Name], Boards. Elements, Mounters. Name As [Mounter Name], Assemblies. Time From Boards, Assemblies, Mounters +
where Boards. [Board_id] =id And Assemblies. [Board_id]=Boards. Board_id And Assemblies. [Mounter_id]=Mounters. Mounter_id raquo ;, conn); param=new SqlParameter () ;. ParameterName= @ id raquo ;;. Value=Convert. ToInt32 (x) ;. SqlDbType=SqlDbType. Int ;. Parameters. Add (param); (SqlDataReader dr=cmd. ExecuteReader ())
{dtTable=new DataTable (); (int i=0; i lt; dr. FieldCount; i ++)
{. Columns. Add (dr. GetName (i). ToString (). Trim ());
} (dr. Read ())
{. Rows. Add (dr. GetValue (0). ToString (). Trim (), dr. GetValue (1). ToString (). Trim (), dr. GetValue (2). ToString (). Trim (), dr. GetValue (3). ToString (). Trim ());
} bind=new Binding () ;. Source=dtTable ;. SetBinding (DataGrid. ItemsSourceProperty, bind) ;. Items. Refresh ();
}. Close () ;. Dispose ();
} void query3_Click (object sender, RoutedEventArgs e)
{start=Interaction. InputBox ( Введіть початкову дату raquo ;, Запит про продукцію raquo ;, raquo ;, 10,10),=Interaction. InputBox ( Введіть кінцеву дату raquo ;, Запит про продукцію raquo ;, raquo ;, 10,10);
SqlConnection conn=new SqlConnection (connStr);
{. Open ();
} (SqlException se)
{. Content=se. Message ;;
} tableName=selectDB. SelectedValue. ToString (); cmd=new SqlCommand ( Select Productions. Date, Boards. Name As [Board Name], Mounters. Name As [Mounter ...