none
Creating a dataview in C# RRS feed

  • Question

  • I need to create a dataview. So I found this MSDN page, copied a piece of code that should work, right? It does not.

    This is the code:

    DataView custDV = new DataView(custDS.Tables["Customers"],   
        "Country = 'USA'",   
        "ContactName",   
        DataViewRowState.CurrentRows);

    What is the CustDS? There is no definition. Sure I get an error at compilation time?

    How is it going to work?

    Thanks.

    Saturday, June 16, 2018 9:39 PM

Answers

  • It looks like I needed to write this statement before. Now everything works:

    DataSet custDS = new DataSet();

    • Marked as answer by MyCatAlex Saturday, June 16, 2018 9:45 PM
    Saturday, June 16, 2018 9:44 PM