开发者

DataSet select statement referencing data from a column that stores a DataRow

开发者 https://www.devze.com 2023-02-14 17:10 出处:网络
I don\'t think what I\'m asking is possible, but I\'m hoping against hope that maybe it is. I have a DataTable where one of the columns is a reference to a DataRow in another table. I want to do a se

I don't think what I'm asking is possible, but I'm hoping against hope that maybe it is.

I have a DataTable where one of the columns is a reference to a DataRow in another table. I want to do a select statement that uses the data开发者_运维百科 of the DataRow as part of the statement. For example, I want to do this:

SomeDataTableWithADateRow.Select("DateRow.Date > " + currentDate);

Where DateRow.Date and currentDate are DateTime objects.

Is this possible?


According to the documentation here: http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx

A select can reference a column in the Parent table is a data relation has been setup.

"A parent table may be referenced in an expression by prepending the column name with Parent. For example, the Parent.Price references the parent table's column named Price."

0

精彩评论

暂无评论...
验证码 换一张
取 消