當前位置: 首頁>>代碼示例>>C#>>正文


C# DataTable.AsDataView方法代碼示例

本文整理匯總了C#中System.Data.DataTable.AsDataView方法的典型用法代碼示例。如果您正苦於以下問題:C# DataTable.AsDataView方法的具體用法?C# DataTable.AsDataView怎麽用?C# DataTable.AsDataView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Data.DataTable的用法示例。


在下文中一共展示了DataTable.AsDataView方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateWIP1

        public CreateWIP1(BatchTreeViewItem sender)
        {
            Sender = sender;
            // WorkItem happens after you click

            InitializeComponent();

            // Do Not Run Until Time
            Time timeUntilTime = new Time(false);
            dataTableUntil = timeUntilTime.TimeDataTable;
            timeUntil.ItemsSource = dataTableUntil.AsDataView();

            // Do Not Run After Time
            Time timeAfterTime = new Time(false); // heh
            dataTableAfter = timeAfterTime.TimeDataTable;
            timeAfter.ItemsSource = dataTableAfter.AsDataView();

            // Recurrence Interval
            Time recurrenceIntervalTime = new Time(true);
            dataTableInterval = recurrenceIntervalTime.TimeDataTable;
            dataGridInterval.ItemsSource = dataTableInterval.AsDataView();

            // Start Window
            Time startWindowTime = new Time(true);
            dataTableWindow = startWindowTime.TimeDataTable;
            dataGridWindow.ItemsSource = dataTableWindow.AsDataView();

            Loaded += OnLoaded;

            MainWindow.Resize(MainGrid);
        }
開發者ID:romitgirdhar,項目名稱:azure-batch-samples,代碼行數:31,代碼來源:CreateWIP1.xaml.cs

示例2: GeneratePivotTable

 public static DataView GeneratePivotTable(DataTable sourceTable, DateTime startDate)
 {
     var pivotTable = new DataTable();
     GeneratePivotColumns(pivotTable, startDate);
     GeneratePivotRows(sourceTable, pivotTable);
     return pivotTable.AsDataView();
 }
開發者ID:dreckner,項目名稱:RecknerSharePointSolutions,代碼行數:7,代碼來源:ParTimeAveragesUserControl.ascx.cs

示例3: Einstellungen

        public Einstellungen()
        {
            InitializeComponent();
            string appPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Simple Radio");
            csv = new CSVManager(appPath, "radiolist.csv");
            table = new DataTable("Inhalt");
            table = csv.GetTableFromFile(); //aus radiolist.csv

            dataGrid1.ItemsSource = table.AsDataView();
        }
開發者ID:EricLambrecht,項目名稱:InternetRadio,代碼行數:10,代碼來源:Einstellungen.xaml.cs

示例4: PopulateOrders

 private void PopulateOrders()
 {
     //UpdateGrid(dtgOrders, "SELECT * FROM OrderLine");
     var dt = new DataTable();
     using (var da = new SqlDataAdapter("SELECT * FROM OrderLine", con))
     {
         da.Fill(dt);
     }
     dtgOrders.DataSource = dt.AsDataView();
     con.Close();
  }
開發者ID:Hashana,項目名稱:SDIAF,代碼行數:11,代碼來源:Main.cs

示例5: ResizePool

        public ResizePool(PoolViewModel pool)
        {
            InitializeComponent();

            Pool = pool;

            // Resize Timeout
            Time resizeTime = new Time(true);
            dataTableResize = resizeTime.TimeDataTable;
            datagridResize.ItemsSource = dataTableResize.AsDataView();
        }
開發者ID:romitgirdhar,項目名稱:azure-batch-samples,代碼行數:11,代碼來源:ResizePool.xaml.cs

示例6: FillData

        void FillData()
        {
            SQLiteConnection m_dbConnection = new SQLiteConnection("Data Source=C:\\IDDBShared\\IDDatabase.sqlite;Version=3;");
            m_dbConnection.Open();

            using (SQLiteDataAdapter myAdapter = new SQLiteDataAdapter("select * from ShopStock", m_dbConnection))
            {
                DataTable myData = new DataTable();
                myAdapter.Fill(myData);
                Stock.ItemsSource = myData.AsDataView();
            }
        }
開發者ID:Revenir,項目名稱:Stock-Manager,代碼行數:12,代碼來源:ViewDatabase.xaml.cs

示例7: FillData

        void FillData()
        {
            SQLiteConnection m_dbConnection = new SQLiteConnection("Data Source=C:\\IDDBShared\\IDDatabase.sqlite;Version=3;");
            m_dbConnection.Open();

            string finder = "select * from StockAdditions WHERE SKUNumber = " + SKUNumber.Content;

            using (SQLiteDataAdapter myAdapter = new SQLiteDataAdapter(finder, m_dbConnection))
            {
                DataTable myData = new DataTable();
                myAdapter.Fill(myData);
                StockAdditions.ItemsSource = myData.AsDataView();
            }
        }
開發者ID:Revenir,項目名稱:Stock-Manager,代碼行數:14,代碼來源:ViewReport.xaml.cs

示例8: FillData

        void FillData()
        {
            SQLiteConnection m_dbConnection = new SQLiteConnection("Data Source=C:\\IDDBShared\\IDDatabase.sqlite;Version=3;");
            m_dbConnection.Open();

            string finder = "select * from Balances WHERE userIDNumber = " + userID.Content;

            using (SQLiteDataAdapter myAdapter = new SQLiteDataAdapter(finder, m_dbConnection))
            {
                DataTable myData = new DataTable();
                myAdapter.Fill(myData);
                YouthTransactions.ItemsSource = myData.AsDataView();
            }
        }
開發者ID:Revenir,項目名稱:ID-DB,代碼行數:14,代碼來源:ViewReport.xaml.cs

示例9: Price_Undefined_Window

 public Price_Undefined_Window(string sTitle,DataTable xdt_price_Item_view,CodeTables.DBTableControl xdbTables)
 {
     InitializeComponent();
     this.Title = sTitle;
     this.btn_Edit.Content = lngRPM.s_EditPriceList.s;
     this.btn_Cancel.Content = lngRPM.s_Cancel.s;
     dt_price_Item_view = xdt_price_Item_view;
     dbTables = xdbTables;
     this.dgvx_PriceUndefinedItem.ItemsSource = dt_price_Item_view.AsDataView();
     tbl = new SQLTable(dbTables.GetTable(typeof(Atom_cAddress_Org)));
     tbl.CreateTableTree(dbTables.items);
     this.dgvx_PriceUndefinedItem.AutoGeneratedColumns +=dgvx_PriceUndefinedItem_AutoGeneratedColumns;
     //this.dgvx_PriceUndefinedItem.Columns[0].Header =
 }
開發者ID:dstrucl,項目名稱:Tangenta40,代碼行數:14,代碼來源:Price_Item_Undefined.xaml.cs

示例10: CreateWIP2

        public CreateWIP2(BatchTreeViewItem sender, WorkItem wi)
        {
            InitializeComponent();
            this.Sender = sender;
            workitem = wi;

            // Wall Clock Time
            Time wallClockTime = new Time(true);
            dataTableWallClock = wallClockTime.TimeDataTable;
            dataGridWallClock.ItemsSource = dataTableWallClock.AsDataView();

            Loaded += OnLoaded;

            MainWindow.Resize(MainGrid);
        }
開發者ID:romitgirdhar,項目名稱:azure-batch-samples,代碼行數:15,代碼來源:CreateWIP2.xaml.cs

示例11: CreatePoolP1

        public CreatePoolP1(BatchTreeViewItem sender, object obj)
        {
            this.Sender = sender;
            InitializeComponent();

            pool = null;
            workitem = null;

            DataTable dataTable2 = new DataTable();
            dataView = dataTable2.AsDataView();
            envGrid.ItemsSource = dataView;
            dataTable2.Columns.Add("Name", typeof(string));
            dataTable2.Columns.Add("Value", typeof(string));
            //envGrid.ColumnWidth = new DataGridLength(1, DataGridLengthUnitType.Star);
            DataRow row2 = dataTable2.NewRow();
            dataTable2.Rows.Add(row2);

            // Resize Timeout
            Time resizeTime = new Time(true);
            dataTableResize = resizeTime.TimeDataTable;
            datagridResize.ItemsSource = dataTableResize.AsDataView();

            if (obj is Pool)
            {
                this.pool = obj as Pool;
            }
            else if (obj is WorkItem)
            {
                lblTitle.Content = "WorkItem Autopool Specifications";
                txtName.IsEnabled = false;
                lblName.IsEnabled = false;
                lblNameStar.Width = 0;
                this.workitem = obj as WorkItem;
            }
            else
            {
                System.Windows.MessageBox.Show("CreatePoolP1.xaml.cs: Improper object passed in");
            }

            btnNext.Content = "Done";

            Loaded += OnLoaded;

            MainWindow.Resize(MainGrid);
        }
開發者ID:romitgirdhar,項目名稱:azure-batch-samples,代碼行數:45,代碼來源:CreatePoolP1.xaml.cs

示例12: CreateTaskP1

        public CreateTaskP1(BatchTreeViewItem sender)
        {
            Sender = sender;
            InitializeComponent();

            // Wall Clock Time
            Time wallClockTime = new Time(true);
            dataTableWallClock = wallClockTime.TimeDataTable;
            dataGridWallClock.ItemsSource = dataTableWallClock.AsDataView();

            // Retention Time
            Time retentionTime = new Time(true);
            dataTableRetention = retentionTime.TimeDataTable;
            dataGridRetention.ItemsSource = dataTableRetention.AsDataView();

            Loaded += OnLoaded;

            MainWindow.Resize(MainGrid);
        }
開發者ID:romitgirdhar,項目名稱:azure-batch-samples,代碼行數:19,代碼來源:CreateTaskP1.xaml.cs

示例13: btnGetClients_Click

        private void btnGetClients_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DataTable table = new DataTable("Customers");
                using (SqlConnection connection = new SqlConnection(Properties.Settings.Default.Database))
                {
                    string query = "SELECT firstname, lastname, address, city FROM vCustomers";
                    SqlDataAdapter adapter = new SqlDataAdapter(query, connection);
                    adapter.Fill(table);
                    connection.Close();
                }
                lbClients.ItemsSource = table.AsDataView();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
開發者ID:Crowmoore,項目名稱:IIO11300,代碼行數:20,代碼來源:MainWindow.xaml.cs

示例14: CreateWIP3

        public CreateWIP3(BatchTreeViewItem sender, WorkItem parent)
        {
            this.workitem = parent;
            this.Sender = sender;
            InitializeComponent();

            // Wall Clock Time
            Time wallClockTime = new Time(true);
            dataTableWallClock = wallClockTime.TimeDataTable;
            dataGridWallClock.ItemsSource = dataTableWallClock.AsDataView();

            // Retention Time
            Time retentionTime = new Time(true);
            dataTableRetention = retentionTime.TimeDataTable;
            dataGridRetention.ItemsSource = dataTableRetention.AsDataView();

            Loaded += OnLoaded;

            MainWindow.Resize(MainGrid);
        }
開發者ID:romitgirdhar,項目名稱:azure-batch-samples,代碼行數:20,代碼來源:CreateWIP3.xaml.cs

示例15: FillData

        void FillData()
        {
            SQLiteConnection m_dbConnection = new SQLiteConnection("Data Source=C:\\IDDBShared\\IDDatabase.sqlite;Version=3;");
            m_dbConnection.Open();

            using (SQLiteDataAdapter myAdapter = new SQLiteDataAdapter("select * from Users", m_dbConnection))
            {
                DataTable myData = new DataTable();
                myAdapter.Fill(myData);
                UserID.ItemsSource = myData.AsDataView();
            }

            //            string sql = "select * from Users";
            //            SQLiteCommand command = new SQLiteCommand(sql, m_dbConnection);
            //            SQLiteDataReader reader = command.ExecuteReader();

            //            while (reader.Read())
            //            {
            //
            //            }
        }
開發者ID:Revenir,項目名稱:ID-DB,代碼行數:21,代碼來源:ViewDB.xaml.cs


注:本文中的System.Data.DataTable.AsDataView方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。