1
我在使用wpf在c#中編寫應用程序,我想知道如何在wpf中創建數據表?這是一個非常愚蠢的問題,我知道,但它並不像我使用正確的引用,因爲當我嘗試創建它時,數據表對象從不出現。我引用如下:如何在wpf中創建Datatable?
using System;
using System.Collections.Generic;
using System.Text;
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;
using System.IO;
using System.Linq;
using System.ComponentModel;
using System.Data.Sql;
不要在WPF中使用'System.Data.DataTable'。這是一個非常糟糕的方式來存儲您的數據。改爲創建適當的數據模型。 –
@HighCore你可以開發一點爲什麼在Windows窗體中這很方便,但在WPF中不能?或者這是一個也適用於WPF以外的聲明? – Dereckson
有關答案,請參閱以下問題:http://stackoverflow.com/questions/6984686/convert-and-use-datatable-in-wpf-datagrid – Dereckson