Can someone see what is wrong with the code below?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jensen bredal

    #1

    Can someone see what is wrong with the code below?

    *************** *****
    DataTable SampleTable = new DataTable();

    //DataAdapter fill code in here.

    DataColumn ExpressionColum n = new DataColumn("Ind exer",
    typeof(System.I nt32));

    ExpressionColum n.AutoIncrement = true;

    ExpressionColum n.AutoIncrement Step = 1;//It defaults to 1 - I just put it
    here for clarity

    ExpressionColum n.AutoIncrement Seed = 0;//Again, it defaults to this - I just
    included it for clarity

    DataView SampleView = SampleTable.Def aultView;

    SampleView.RowF ilter = "Indexer < " + topValue.ToStri ng();

    //You may want to include a minValue as well and change the rowfilter so
    that you can specify other

    //ranges, but by defaulting to 0 - you'll effectively have your Top
    Condition

    }
    *************** ********
    i'm expecting the ExpressionColum n of SampleView to contain 0,1,2......n

    instead i get System.DBNull.

    What is wrong?

    Thanks

    JB



  • jensen bredal

    #2
    Re: Can someone see what is wrong with the code below?

    Omited that "ExpressionColu mn" column is added to SampleTable.

    SampleTable.Col umn.Add(Express ionColumn);


    Comment

    Working...