linqtodataset中的查询(编辑修改稿)内容摘要:

Lambda 表达式作为参数进行传递。 有关更多信息,请参见 Lambda Expressions。 此示例使 用 Select 返回 Product 中的所有行并显示产品名称。 Visual Basic 复制代码 39。 Fill the DataSet. Dim ds As New DataSet() = 39。 See the FillDataSet method in the Loading Data Into a DataSet topic. FillDataSet(ds) Dim products As DataTable = (Product) Dim query = () _ .Select(Function(product As DataRow) New With _ { _ .ProductName = (Of String)(Name), _ .ProductNumber = (Of String)(ProductNumber), _ .Price = (Of Decimal)(ListPrice) _ }) (Product Info:) For Each product In query (Product name: amp。 ) (Product number: amp。 ) (List price: $ amp。 ) Next C 复制代码 // Fill the DataSet. DataSet ds = new DataSet()。 =。 FillDataSet(ds)。 DataTable products = [Product]。 var query = (). Select(product = new { ProductName = string(Name), ProductNumber = string(ProductNumber), Price = decimal(ListPrice) })。 (Product Info:)。 foreach (var productInfo in query) { (Product name: {0} Product number: {1} List price: $。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。