私はあなたがそれを書いたように、答えはいいえです。あなたが表示している関数は、データテーブルのDataColumnの機能であるExpressionのプロパティを利用しています。
効果的に、それはあなたがSQLに見つけるだろう演算子の多くをサポートしています。
ドキュメントから:
OPERATORS
Concatenation is allowed using Boolean AND, OR, and NOT operators. You can use parentheses to group clauses and force precedence. The AND operator has precedence over other operators. For example:
(LastName = 'Smith' OR LastName = 'Jones') AND FirstName = 'John'
When creating comparison expressions, the following operators are allowed:
<
>
<=
>=
<>
=
IN
LIKE
The following arithmetic operators are also supported in expressions:
+ (addition)
- (subtraction)
* (multiplication)
/(division)
% (modulus)
STRING OPERATORS
To concatenate a string, use the + character. Whether string comparisons are case-sensitive or not is determined by the value of the DataSet class's CaseSensitive property. However, you can override that value with the DataTable class's CaseSensitive property.
WILDCARD CHARACTERS
Both the * and % can be used interchangeably for wildcards in a LIKE comparison. If the string in a LIKE clause contains a * or %, those characters should be escaped in brackets ([]). If a bracket is in the clause, the bracket characters should be escaped in brackets (for example [[] or []]). A wildcard is allowed at the beginning and end of a pattern, or at the end of a pattern, or at the beginning of a pattern. For example:
"ItemName LIKE '*product*'"
"ItemName LIKE '*product'"
"ItemName LIKE 'product*'"
Wildcards are not allowed in the middle of a string. For example, 'te*xt' is not allowed.
PARENT/CHILD RELATION REFERENCING
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.
A column in a child table may be referenced in an expression by prepending the column name with Child. However, because child relationships may return multiple rows, you must include the reference to the child column in an aggregate function. For example, Sum(Child.Price) would return the sum of the column named Price in the child table.
If a table has more than one child, the syntax is: Child(RelationName). For example, if a table has two child tables named Customers and Orders, and the DataRelation object is named Customers2Orders, the reference would be:
Avg(Child(Customers2Orders).Quantity)
AGGREGATES
The following aggregate types are supported:
Sum (Sum)
Avg (Average)
Min (Minimum)
Max (Maximum)
Count (Count)
StDev (Statistical standard deviation)
Var (Statistical variance).
Aggregates are usually performed along relationships. Create an aggregate expression by using one of the functions listed above and a child table column as detailed in PARENT/CHILD RELATION REFERENCING above. For example:
Avg(Child.Price)
Avg(Child(Orders2Details).Price)
残念ながら、平方根はあなたが使用できる機能の一つではありません。ただし、DataTableを使用しているときは、単に行をループし、列の値から直接SquareRootを計算することができます。 「MyNumber」という列があるとします。あなたが望んだ場合は、Extensionメソッドに機能のこの種を置くことができ
myDataTable.Columns.Add(new DataColumn() { Name = "MySquareRoot", DataType = typeof(Double)});
foreach(DataRow row in myDataTable.Rows)
{
myDataTable["MySquareRoot"] = Math.Sqrt(Convert.ToDouble(myDataTable["MyNumber"]));
}
:あなたは、その後のような何かを行うことができます。
また、数式を別の場所で処理することもできます。 DataTableを使用してデータをモデル化するのではなく、クラスを使用できます。クラス自体は、データを表すプロパティ(またはリストまたはコレクション)と、データに作用するメソッドを持つことができます.C#で必要な関数を使用できます。
「オンラインのどこかから」正確に何を使用していますか? – Randy
あなたが何を求めているのか正確にはわかりません。私はどこでそれを得るのかということを意味するならば、私は文字列方程式を解析する能力に関する質問に答えるこのようなフォーラムから得ました。 私が使っているものを聞いているのなら、それは私が学校に持っているプロジェクトのためです。データベースから引き出された数式を解析する必要があります。 – Cityonhill93
'string.Emptyの代わりに。GetType() 'あなたは' typeof(string) 'を書くことができます。 –