1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| public void InitialiseDataSource() {
DataSetfromXsd ds = new DataSetfromXsd("scStructure.xsd");
//pour verif
dataGridView1.DataSource = ds.Tables[1];
;}
//***----
public class DataSetfromXsd : DataSet
{
public DataSetfromXsd() : base() {}
//nom de la table des colonnes combo
protected const string tCombofieldTableNames = "tCombofield";
protected DataSet _dsc = new DataSet();
public DataSetfromXsd(string _xsdfile)
{
//rempli les table du dataset _dsc avec les valeurs du xsd
DataSetWithComboTables(_xsdfile, ref _dsc);
base.DataSetName = _dsc.DataSetName;
//!!! c'est la que je ne suis pas fière// :roll:
foreach (DataTable dt in _dsc.Tables) {
DataTable _dt = dt.Copy();
base.Tables.Add(_dt);
;}
;}......
public static void DataSetWithComboTables(string xsdfile, ref DataSet ds)
..............} |
Partager