Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB, C#, and VFP data handling examples
Message
 
To
04/05/2007 23:11:12
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01215120
Message ID:
01222829
Views:
41
LINQ is smart enough to handle the typing based on the types. The only reason it doesn't becacuse he's using a DataTable. If you query directly from the database into a LINQ query you don't have this issue.

I'm not sure why you would use a DataTable as an intermediary in any case. That's going to be a specialty case.


+++ Rick ---


>Kevin,
>
>Why should I, as a poor developper care about the datatype ?? I would like to avoid query no 1 at all costs as it is backward programming. The development tool should handle it. Now I know you all feel strongly about strict typing, but any way you cut it, either using typed datasets or not, if the field definition changes on the server you still have a problem.
>
>I would like to see LinQ do this totally transparent and generate an error if there is a type conflict at runtime in the case the type cannot be determined at compile time.
>
>Case in point is that in my applications I use 'remote views' (in .net would be typed datasets), SPs and SPTs transparently. VFP does not care where it comes from, and why the hell should this restriction exist in .NET ? To me it only adds to the frustration of the developer to deal with type casting again and again beyond any reasonable point. Sure, compile time checking is an important feature that certainly has advantages over the VFP way, but in this case (but also in late binding COM objects) it is just a PITA in many respects and hurts productivity, maintainability and readability.
>
>I know you mentioned ".NET generics" to overcome some of those problems, but IMO it fails to address the real issue here.
>
>Walter,
>
>
>>your preference for Typed DataSets rules in April 2007...
>>
>>In LINQ to DataSets (as of today), if you query against an untyped datatable...
>>
>>
>>var Query =
>>   from rowData in dtWorkers.AsEnumerable()
>>      where rowData.Field<string>("FirstName") == "Kevin"
>>       || rowData.Field<decimal>("Salary") > 90000
>> select rowData;
>>
>>
>>If you query against a typed datatable...
>>
>>
>>var Query =
>>   from rowData in dtWorkers.AsEnumerable()
>>      where rowData.FirstName == "Kevin"
>>       || rowData.Salary > 90000
>> select rowData;
>>
>>
>>
>>Which would you prefer?
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform