Emre,
I think you mean the DataSet only has one table.
The DataRelation instances that are exposed by the DataSet class are the
in-memory representations of the relations between the DataTable instances.
Unless they are constructed and placed in the data set, they won't be there.
Usually, the designer will create the relations between the data tables for
you when you drag and drop tables from the server explorer to the data set
designer.
However, since you say you only have one data table in the data set, I
don't see how you can have any relations represented locally, because you
don't have another data table to relate to.
That being said, if you need relation information from the database, you
are going to have to query the database for it.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Emre DİNÇER" <ed*****@meteksan.com.trwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Dear All,
is it possible to extract the DataColumn which is a foreign key of another
table. The DataTable has only one table.
foreach (DataRelation dr in dsIlce.Tables[0].ParentRelations) {
Console.WriteLine("123");
console.WriteLine(dr.ParentTable.TableName.ToStrin g());
}
prints nothing unfortunately..