Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 11th, 2003, 03:42 AM
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataTable.Select() method bug

Hello,

I'm in urgent need of using the DataTable's Select()-method, but there appears to be a bug that makes the method not return all of the matches. When searching for an Int32 (or long) primary key, most of the rows are found, some are not (eg. "ID=1738933665" is found and "ID=1956736656" is not, but both are there).

Here you can a sample code for the bug:
http://www.aewnet.com/newsgroups/rne...50756&group=21

I haven't found any information at microsoft.com, nor anywhere else. I'm using the .NET Framework 1.0 (VS 2002).

Thanks in advance!!

-JAN
 
Old August 11th, 2003, 03:49 AM
Authorized User
 
Join Date: Jun 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, there's a bug in .NET framework 1.0
Try to use .NET Framework 1.1
or create DataView and use FilterRow property.
 
Old October 5th, 2009, 11:12 AM
Registered User
 
Join Date: Dec 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am useing Visual Studio 2005 and framework 2.0 and am also getting incosistant results with the SELECT method of a datatable. I have added 2 tables to a dataset; one parent, one child. I am using a development environment so the data in each table is known and controlled. Stepping through the VB code, I can see where the select is sometimes failing (although some selects are working). This does not make sense to me since the same code adds records to the parent and child tables.
 
Old October 5th, 2009, 12:24 PM
Registered User
 
Join Date: Dec 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Talking datatable select method fix

I fixed my problem with the datatable select method.
I am using framework 2.0 (Visual Studio 2005)

The fix is to add more qualifiers to the datatable column creation
My original code said
SubDT.Columns.Add("ContractID")

The revised code says
SubDT.Columns.Add("ContractID", System.Type.GetType("System.Int32"))

The SELECT method was fixed by more fully describing the column type in the tabel creation routine.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Bug in the highlight method for form objects cheets BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 June 11th, 2009 08:05 PM
c# method Select() twb C# 0 November 18th, 2006 02:59 PM
how to use DataTable.Select Salte C# 2 December 22nd, 2004 04:28 AM
Return DataTable from Web Method Function kasie ASP.NET 1.0 and 1.1 Basics 2 February 11th, 2004 06:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.