本文整理匯總了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);
}
示例2: GeneratePivotTable
public static DataView GeneratePivotTable(DataTable sourceTable, DateTime startDate)
{
var pivotTable = new DataTable();
GeneratePivotColumns(pivotTable, startDate);
GeneratePivotRows(sourceTable, pivotTable);
return pivotTable.AsDataView();
}
示例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();
}
示例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();
}
示例5: ResizePool
public ResizePool(PoolViewModel pool)
{
InitializeComponent();
Pool = pool;
// Resize Timeout
Time resizeTime = new Time(true);
dataTableResize = resizeTime.TimeDataTable;
datagridResize.ItemsSource = dataTableResize.AsDataView();
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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 =
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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())
// {
//
// }
}