problem about linq-to-dataset-Collection of common programming errors


  • 13 revsTim Schmelter
    .net vb.net linq compiler linq-to-dataset
    Edit: Here is a much more simpler example of this issue (i’ve deleted my original question):Dim numbers1 As New List(Of Int32)({1, 2, 3}) Dim numbers2 As New List(Of Int32)({3, 4, 5}) For Each n1 In numbers1′ no warning ‘Dim contains = numbers2.Contains(n1) Next For Each n1 In numbers1’ warning on n1’Dim contains = (From num In numbers2 Where num = n1).Any NextSo i still don’t understand why the compiler thinks that i may get unexpected results in the second iteration whereas i’m safe with the f

  • O.O
    c# generics linq-to-dataset
    I have a method that determines the min and max of a column in a DataTable:public void GetMinMaxRange( DataTable data, string valueColumnName ) {var min = data.AsEnumerable().Min(m => m.Field<double>(valueColumnName));var max = data.AsEnumerable().Max(m => m.Field<double>(valueColumnName)); }I want to refactor this to be:public void GetMinMaxRange( DataTable data, string valueColumnName ) {DataColumn column = data.Columns[valueColumnName];var min = data.AsEnumerable().Min(m =&g

  • julien
    c# linq dataset strongly-typed-dataset linq-to-dataset
    Here is the configuration of my datatables that I use in my linq query: I have 2 dataset files (all the columns of all the tables have a DataType specified and their AllowDbNull property set to True): * deposit_position_imbalance.xsd:Contains 2 datables : – Imbalance- ImbalanceDetailForRealTime * dep_pos_imbalance_detail.xsd:Contains 1 datatable : – TableIn the code below, the problem lies in the 2 lines “deal_date = b.deal_date”. Indeed, when I retrieve from the database b.deal_date that has a

  • Jay Stevens
    c# datetime linq-to-dataset
    I need to get the minimum DateTime value of a column in a DataTable. The DataTable is generated dynamically from a CSV file, therefore I don’t know the name of that column until runtime. Here is code I’ve got that doesn’t work…private DateTime GetStartDateFromCSV(string inputFile, string date_attr) {EnumerableRowCollection<DataRow> table = CsvStreamReader.GetDataTableFromCSV(inputFile, “input”, true).AsEnumerable();DateTime dt = table.Select(record => record.Field<DateTime>(dat

Web site is in building