Answer the question
In order to leave comments, you need to log in
How to set DataColumn.Expression for DataRelation?
Hello. There is an object theDataSet.
it has 2 tables:
Users:
Id, Name
Operations:
User_Id, Date, Description
Tables are linked using DataRelation
DataRelation theDataRelation = new DataRelation("Name",
Id_DataColumn_In_Users, User_Id_DataColumn_In_Operations)
theDataSet.Relations.Add(theDataRelation);
So, I want to add a calculated column to theDataSet.Tables["Operations"] that would show the username from Users.Name based on Users.Id and theDataRelation
PS Tips like "do it in the query" do not work, because I have there is only a ready-made DataSet, I do not get it directly from the database.
ZZY Tips, such as "do it with pens" do not fit. Before that, I would have thought of it myself, but I don’t want to go through a cycle of dohrena rows to insert the name I need throughout the new column, for this there are calculated columns using DataColumn.Expression, which calculate the value when accessed.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question