I have two Tables:
Table 1: Client
Fields: Id_Client Char 5 Name_Client Char 50
Table 2: Country
Fields: Id_Country Char 4 Name_Country Char 80 Population Int 15
With Sql I can make this 2 queries
Select Id_Client, Name_Client from Client
Select Id_Country, Name_Country, Population from Country
I wan to do this 2 queries in only one using Linq SQL. I think something like this
string Option = "";
string SelectFields = ""; string TableName = "";
if (Option == "Client"){
SelectFields = "Id_Client, Name_Client"; TableName = "Client";
} else{
SelectFields = "Id_Country, Name_Country, Population"; TableName = "Country";
}
Select "SelectFields" from "TableName"
I'm a Visual Fox Pro Developer and using Evaluate (macros) this is very easy to do. Is possible to do something like this on Linq To Sql???
Sorry for my poor english