Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EVALUATE() Equivalent function in .NET
Message
From
17/07/2007 19:33:44
 
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01241330
Message ID:
01241351
Views:
31
This function does look great if you know your variable in advance. But, that's why EVALUATE() is so powerful, because you don't have to know the variable in advance, you can pass a string "name" to it and it will evaluate it. For example:

x = "company.name"
y = EVALUATE(x)
? y && Displays... ABC Company

So the $64 question is, is there anything like that in C#?

bob


>You can use the StringBuilder class:
>
>StringBuilder sb = new StringBuilder();
>sb.Append("SELECT *");
>sb.AppendFormat(" FROM {0}",YourTableName);
>sb.AppendFormat(" WHERE cName LIKE '{0}%'", WorkGroup);
>sb.AppendFormat(" AND dIntervalStart >= '{0}' AND dIntervalStart < '{1}'", StartDate, EndDate);
>sb.Append(" GROUP BY cName");
>string sql = sb.ToString();
>
>SqlConnection cn = new SqlConnection(SqlDataSource);
>SqlCommand cm = new SqlCommand(sql, cn);
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform