none
what is function of the "source" field RRS feed

  • Question

  • Hi all,

    could you tell me the function of the "source" field on the property window of a column in a datatable. why the associated dropdwon list does not include all fields of a datatable.

    Thank you very much

    Clara
    Thursday, May 28, 2009 4:02 PM

Answers

  • Basically it does exactly what it says :-)

    The Source property of the datacolumn in a datatable in a dataset is the column in the backing database.
    This is obviously theres so that the correct column is mapped from the backing database to the dataset.

    You can in the datatable in the dataset change the columnname if you wish, but if you do that, then the datatable still needs to know what the backing column is.
    In other words, if you rename a column from Employee to Emps, then you can use Emps in the typed dataset, but when you perform actions on the datatable
    the underlying code needs to know what Emps really is (or what the source column is). In this case the Source is Employees.

    For the dropdown, this will only contain the columns that was selected when the datatable was created. Rember that you can from the Server Explorer not only drag
    and drop the whole table, you can also select a smaller set of columns and drag and drop them. This will create a datatable with the same name as the table in the
    backing database, however, it will only contain the columns that you choosed, and populate the dropdown accordingly.

    Hope this makes sense :-)
    //Michael


    This posting is provided "AS IS" with no warranties.
    Friday, May 29, 2009 7:59 AM

All replies

  • I couldn't see a property called "Source" for a column.  You wouldn't happen to be referring to SourceColumn on a parameter object -- not a DataColumn object, would you?

    Thursday, May 28, 2009 10:48 PM
  • Basically it does exactly what it says :-)

    The Source property of the datacolumn in a datatable in a dataset is the column in the backing database.
    This is obviously theres so that the correct column is mapped from the backing database to the dataset.

    You can in the datatable in the dataset change the columnname if you wish, but if you do that, then the datatable still needs to know what the backing column is.
    In other words, if you rename a column from Employee to Emps, then you can use Emps in the typed dataset, but when you perform actions on the datatable
    the underlying code needs to know what Emps really is (or what the source column is). In this case the Source is Employees.

    For the dropdown, this will only contain the columns that was selected when the datatable was created. Rember that you can from the Server Explorer not only drag
    and drop the whole table, you can also select a smaller set of columns and drag and drop them. This will create a datatable with the same name as the table in the
    backing database, however, it will only contain the columns that you choosed, and populate the dropdown accordingly.

    Hope this makes sense :-)
    //Michael


    This posting is provided "AS IS" with no warranties.
    Friday, May 29, 2009 7:59 AM