Sie sind auf Seite 1von 9

1/20/14

A Practical Guide to .NET DataTables, DataSets and DataGrids - Part 3 - CodeProject


10,332,373 members (70,435 online) Sign in

home

articles

quick answers

discussions

features

community

help
Next

Search for articles, questions, tips

Articles Desktop Development Grid & Data Controls DataSets, DataGrids etc

Article Browse Code Stats Revisions Alternatives Comments & Discussions (39)

A Practical Guide to .NET DataTables, DataSets and DataGrids - Part 3


By Pete2004, 23 Feb 2004
Rate this: 4.59 (28 votes)
Tw eet 0 Like 0 0 0

About Article
The purpose of this document is to provide a practical guide to using Microsofts .NET DataTables, DataSets and DataGrid Type Licence First Posted Views Bookmarked 23 Feb 2004 251,356 142 times Article

4 Data Sets 4.1 DataSet Methods


DataSet Method Description Accepts all changes to the DataSet Removes all rows from all tables in the DataSet that is, removes all data. Creates a new DataSet with all tables having the same Table structure including any constraints and relationships. No Data is copied. Same as for the DataSet C l o n e ( ) but it includes all Data. Creates a DataSet that contains all changes made to the dataset. If AcceptChanges was called then only changes made since the last call are returned. Returns true if any changes were made to the DataSet including adding tables and modifying rows. Outputs an XML file containing schema with all Tables, Data, Constraints and relationships. Inputs an XML file containing schema, Tables, Data, Constraints and relationships..

.NET1.0 .NET1.1 C# Windows Visual-Studio , +

A c c e p t C h a n g e s ( )

C l e a r ( )

C l o n e ( )

C o p y ( )

G e t C h a n g e s ( )

H a s C h a n g e s ( )

W r i t e X m l ( )

R e a d X m l ( )

4.2 DataSet Properties


DataSet Property Description

www.codeproject.com/Articles/6180/A-Practical-Guide-to-NET-DataTables-DataSets-and-D

1/9

1/20/14

A Practical Guide to .NET DataTables, DataSets and DataGrids - Part 3 - CodeProject

C a s e S e n s i t i v e

If set to true then string compares in DataSet tables are case sensitive otherwise they are not. Name of the DataSet Returns true if there are any errors within any tables in the DataSet Collection of Relations Method/PropertyDescription

Top News
Programmers without TDD will be unemployable by 2022
Get the Insider News free each morning.

D a t a S e t N a m e

H a s E r r o r s

Related Videos

A d d ( )
If two or more relations are to be added to the collection they can be added using this method. They are appended to the existing collection in the order specified in the range. Returns true if the relation can be removed from the collectionn Removes all relations from the relations collection Returns a true if the collection contains the named relation. Returns the number of relations in the collection Returns the index of a relation in the collection equal to name. Removes a relation by Name from the collection Removes a relation by index from the collection.

A d d R a n g e ( )

C a n R e m o v e

Related Articles
Matrix Multiplication in C# Creating animations with Dundas Chart for ASP.NET Smarter Data Labels with Dundas Chart SmartLabels Understanding Chart Areas with Dundas Chart for .NET A Formatted Text Box Using screensavers inside the Windows Media Player Making Sense of Geographic Data with Dundas Map and AJAX Handling connection notification between a desktop machine and Windows CE based devices Create data-driven applications with the Hera Application Framework Towards the self-documenting database: extended properties Accessibility audit vs. accessibility testing Digital Signatures and PDF Documents Color Scale Filter Merge Landscape and Portrait PDFs using ASP.NET Using Barcodes in Documents Best Practices How to Retrieve EMC Centera Cluster/Pool Capabilities Embedding IronPython in WPF Using C# "Hey! Is That My Car? How to Sharpen a QuickBird Satellite Image Using DotImage" Integrate your SharePoint environment into the open standards-based WebSphere Portal platform using the Visual Studio IDE

R e l a t i o n s s

C l e a r ( )

C o n t a i n s ( )

C o u n t

I n d e x O f ( )

R e m o v e ( )

R e m o v e A t ( )

Collection of Tables Method/PropertyDescription

A d d ( )

Adds a table to the collection If two or more tables are to be added to the collection they can be added using this method. They are appended to the existing collection in the order specified in the range. Removes all tables from the collection Returns a true if the collection contains a table with TableName equal to name.

A d d R a n g e ( )

C l e a r ( ) T a b l e s

C o n t a i n s ( )

Returns the number of tables in the www.codeproject.com/Articles/6180/A-Practical-Guide-to-NET-DataTables-DataSets-and-D

2/9

1/20/14

A Practical Guide to .NET DataTables, DataSets and DataGrids - Part 3 - CodeProject

C o u n t

Returns the number of tables in the collection Returns the index of a table in the collection with a TableName equal to name. Removes a table by TableName from the collection

VBScript / Excel 2007 - An easy way to access DBF files Retrieving and Storing Call History

I n d e x O f ( )

Related Research

R e m o v e ( )

R e m o v e A t ( )

Removes a table by index from the collection.


The Essential Guide to Mobile App Testing: Tips for Developers in USA & Canada

4.3 Loading A DataSet


4.3.1 From a Table
Tables created and filled with data as discussed in the Tables section can be added to the Tables collection by using the Add() method or they can be added at once using the A d d R a n g e ( )method. Example of Two equivalent methods used to add tables dtElements and dtIsotopes to the DataSet ElementDS using Add() and AddRange() Method 1 T a b l e s . A d d ( )
Collapse | Copy Code

Protecting Your Business Data: Five Dos and Donts

/ /A d dt h eE l e m e n t st a b l et ot h eD a t a S e t e l e m e n t D S . T a b l e s . A d d ( d t E l e m e n t s ) ; / /A d dt h eI s o t o p e st a b l et ot h eD a t a S e t e l e m e n t D S . T a b l e s . A d d ( d t I s o t o p e s ) ;

Method 2 T a b l e s . A d d R a n g e ( )
Collapse | Copy Code

E l e m e n t D S . T a b l e s . A d d R a n g e ( n e wD a t a T a b l e ( ) { d t E l e m e n t s ,d t I s o t o p e s } ) ;

4.3.2 From a Database


A DataSet tables collection can also be filled with linked tables containing data directly from a database recordset, which is considered bound data.

4.3.2.1 Method 1 sqlDataAdapter

The following code illustrates how to directly load or bind a database recordset using the sqlDataAdapters F i l l ( ) method where the select query string was used to create the recordset. After the Fill() method is called, ds will contain a table in its collection with column headers that match the field names in the select query string and column datatypes will match those specified in the database table elements. Each row will contain data corresponding to each field.
Collapse | Copy Code

S y s t e m . D a t a . S q l C l i e n t . S q l C o n n e c t i o ns q l C o n n e c t i o n 1 ; S y s t e m . D a t a . S q l C l i e n t . S q l D a t a A d a p t e rs q l D a t a A d a p t e r 1 ; S y s t e m . D a t a . S q l C l i e n t . S q l C o m m a n ds q l S e l e c t C o m m a n d 1 ; s q l C o n n e c t i o n 1=n e wS y s t e m . D a t a . S q l C l i e n t . S q l C o n n e c t i o n ( ) ; s q l D a t a A d a p t e r 1=n e wS y s t e m . D a t a . S q l C l i e n t . S q l D a t a A d a p t e r ( ) ; s q l S e l e c t C o m m a n d 1=n e wS y s t e m . D a t a . S q l C l i e n t . S q l C o m m a n d ( ) ; s q l S e l e c t C o m m a n d 1 . C o m m a n d T e x t=" S E L E C TE l e m e n t s I D ,A t o m i c N b r , + S y m b o l ,A t o m i c M a s s ,E l e m e n tF R O M[ E l e m e n t s ] " ; s q l D a t a A d a p t e r 1 . S e l e c t C o m m a n d=s q l S e l e c t C o m m a n d 1 ; / / / /s q l C o n n e c t i o n 1 / /< r e p l a c ex x x x x ,n n n n na n dd b N a m ew i t ha p p r o p r i a t ev a l u e s > / / s q l C o n n e c t i o n 1 . C o n n e c t i o n S t r i n g= w o r k s t a t i o ni d = x x x x x ; p a c k e t +s i z e = 4 0 9 6 ; u s e ri d = n n n n n ;p w d = y y y y y ; d a t a +s o u r c e = x x x x x ;p e r s i s t +s e c u r i t yi n f o = F a l s e ;i n i t i a lc a t a l o g = d b N a m e ; s q l S e l e c t C o m m a n d 1 . C o n n e c t i o n=s q l C o n n e c t i o n 1 ;

www.codeproject.com/Articles/6180/A-Practical-Guide-to-NET-DataTables-DataSets-and-D

3/9

1/20/14

A Practical Guide to .NET DataTables, DataSets and DataGrids - Part 3 - CodeProject


D a t a S e td s=n e wD a t a S e t ( ) ; s q l D a t a A d a p t e r 1 . F i l l ( d s ) ;

4.3.2.2 Method 2 sqlDataReader


This method is more complex than using the sqlDataAdapters F i l l ( )method, but it allows for preprocessing of data prior to populating table rows and the data is not bound directly to the database. In the example, instead of restricting the database record set to contain distinct Atomic Number rows through a SQL query, it is done programmatically for illustration purposes.
Collapse | Copy Code

s t r i n gS Q L =" S E L E C TE l e m e n t s I D ,A t o m i c N b r ,"+ " S y m b o l ,A t o m i c M a s s ,E l e m e n t +F R O M[ E l e m e n t s ]o r d e rb yA t o m i c N b rA S C " ; s q l C o n n e c t i o ns q l C o n n e c t i o n 1 = n e ws q l C o n n e c t i o n( " c o n n e c t i o ni n f ot oM S D Eo rS Q LS e r v e r2 0 0 0 + ; ) ; s q l C o m m a n ds q l C o m m a n d=n e ws q l C o m m a n d( S Q L , s q l C o n n e c t i o n 1 ) ; s q l C o n n e c t i o n 1 . O p e n ( ) ; s q l D a t a R e a d e re l e m e n t R e a d e r=S q l C o m m a n d . E x e c u t e R e a d e r ( ) ; / /S t a r t i n gw i t ht h ee l e m e n tt a b l ed td e f i n e di n / /t h eT a b l e ss e c t i o n ,a nE l e m e n t I Dc o l u m n / /i sa d d e dt h a tw i l lb eu s e da st h ep r i m a r yk e yf o rt h er o w . D a t a C o l u m nd c=n e wD a t a C o l u m n ( E l e m e n t s I D , S y s t e m . T y p e . G e t T y p e ( S y s t e m . G u i d ) ) ; d t . C o l u m n s . A d d ( d c ) ; / /M a k e E l e m e n t s I D ap r i m a r yk e y : d t . P r i m a r y K e y=n e wD a t a C o l u m n [ ] { d t . C o l u m n s [ " E l e m e n t s I D " ] } ; / /F i l lt a b l ed tw i t hd a t af r o mt h ed a t a b a s et a b l eE l e m e n t s :

Note: the sqlDataReader class has a method that can be used to determine whether a null or non-existent value was returned for a particular cell. For example:
Collapse | Copy Code

I f( ! e l e m e n t R e a d e r . I s D B N u l l ( e l e m e n t R e a d e r . G e t O r d i n a l ( " A t o m i c N b r " ) ) ) { / /f i l lc e l lw i t hv a l u e } e l s e { / /h a n d l et h i sc o n d i t i o n / /f o re x a m p l ef i l lc e l lw i t had e f a u l tv a l u e }

This check has been omitted in the following code for clarity, but it is a good practice to use it.
Collapse | Copy Code

D a t a R o wd r ; i n tP r e v A t o m i c N b r=0 ; t r y { w h i l e ( m y R e a d e r . R e a d ( ) ) { i f( P r e v A t o m i c N b r! =e l e m e n t R e a d e r . G e t I n t 3 2 ( e l e m e n t R e a d e r . G e t O r d i n a l ( " A t o m i c N b r " ) ) ) { P r e v A t o m i c N b r=e l e m e n t R e a d e r . G e t I n t 3 2 ( e l e m e n t R e a d e r . G e t O r d i n a l ( " A t o m i c N b r " ) ) ; d r=d t . N e w R o w ( ) ; d r [ E l e m e n t s I D ]= e l e m e n t R e a d e r . G e t G u i d ( e l e m e n t R e a d e r . G e t O r d i n a l ( " E l e m e n t s I D " ) ) ; d r [ A t o m i c N b r ]=e l e m e n t R e a d e r . G e t I n t 3 2 ( e l e m e n t R e a d e r . G e t O r d i n a l ( " A t o m i c N b r " ) ) ; d r [ S y m b o l ]=e l e m e n t R e a d e r . G e t S t r i n g ( e l e m e n t R e a d e r . G e t O r d i n a l ( " S y m b o l ) ) ; d r [ E l e m e n t ]=e l e m e n t R e a d e r . G e t S t r i n g ( e l e m e n t R e a d e r . G e t O r d i n a l ( " E l e m e n t " ) ) ; d r [ A t o m i c M a s s ]= e l e m e n t R e a d e r . G e t D e c i m a l ( e l e m e n t R e a d e r . G e t O r d i n a l ( " A t o m i c M a s s " ) ) ; d t . R o w s . A d d ( d r ) ; } } } f i n a l l y { e l e m e n t R e a d e r . C l o s e ( ) ; s q l C o n n e c t i o n 1 . C l o s e ( ) ; } d t . A c c e p t C h a n g e s ( ) ; / /A d dt a b l ed tt oan e wd a t a s e td sa n di t st a b l e sc o l l e c t i o n D a t a S e td s=n e wD a t a S e t ( ) ; d s . T a b l e s . A d d ( d t ) ;

www.codeproject.com/Articles/6180/A-Practical-Guide-to-NET-DataTables-DataSets-and-D

4/9

1/20/14

A Practical Guide to .NET DataTables, DataSets and DataGrids - Part 3 - CodeProject

4.4 Linked Tables


This example shows how to link two tables together through a primary key. In this example a Table with TableName of Elements is created with a Primary key of Atomic Number. The second Table with TableName of Isotopes is linked through a relationship coupling its Atomic Number column to Elements primary key.
Collapse | Copy Code

/ /c r e a t ean e wD a t a S e tn a m e dP e r i o d i ct h a tw i l l / /h o l dt w ol i n k e dt a b l e sw i t h / /T a b l e N a m e so fE l e m e n t sa n dI s o t o p e sr e s p e c t i v e l y . D a t a S e te l e m e n t D S=n e wD a t a S e t ( " P e r i o d i c " ) ; / /C r e a t eE l e m e n t sT a b l e D a t a T a b l ed t E l e m e n t s=n e wD a t a T a b l e ( " E l e m e n t s " ) ; d t E l e m e n t s . C o l u m n s . A d d ( " A t o m i cN u m b e r " ,t y p e o f ( i n t ) ) ; d t E l e m e n t s . C o l u m n s . A d d ( " E l e m e n t " ,t y p e o f ( s t r i n g ) ) ; d t E l e m e n t s . C o l u m n s . A d d ( " S y m b o l " ,t y p e o f ( s t r i n g ) ) ; / /M a k e A t o m i cN u m b e r ap r i m a r yk e yi nE l e m e n t st a b l e d t E l e m e n t s . P r i m a r y K e y=n e wD a t a C o l u m n [ ] { d t E l e m e n t s . C o l u m n s [ " A t o m i cN u m b e r " ] } ; / /C r e a t eI s o t o p e sT a b l e D a t a T a b l ed t I s o t o p e s=n e wD a t a T a b l e ( " I s o t o p e s " ) ; d t I s o t o p e s . C o l u m n s . A d d ( " S y m b o l " ,t y p e o f ( s t r i n g ) ) ; d t I s o t o p e s . C o l u m n s . A d d ( " A t o m i cN u m b e r " ,t y p e o f ( i n t ) ) ; d t I s o t o p e s . C o l u m n s . A d d ( " I s o t o p eN u m b e r " , t y p e o f ( i n t ) ) ; d t I s o t o p e s . C o l u m n s . A d d ( " P e r c e n tA b u n d a n c e " , t y p e o f ( S y s t e m . D e c i m a l ) ) d t I s o t o p e s . C o l u m n s . A d d ( " A t o m i cM a s s " ,t y p e o f ( S y s t e m . D e c i m a l ) ) ; / /A d dt a b l e st ot h eD a t a s e t E l e m e n t D S . T a b l e s . A d d R a n g e ( n e wD a t a T a b l e ( ) { d t E l e m e n t s ,d t I s o t o p e s } ) ;

Dataset . R e l a t i o n s . A d d ( )
Collapse | Copy Code

/ /A d dar e l a t i o n s h i pf o rT a b l e sE l e m e n t sa n dI s o t o p e s / /t h r o u g ht h ep r i m a r yk e y A t o m i cN u m b e r i nD a t a S e t / /P e r i o d i ca n dn a m et h er e l a t i o n s h i p I s o t o p e s .T h i sn a m ei s / /u s e di nt h eD a t a G r i dt os e l e c tt a b l er o w s ,i nt a b l eI s o t o p e s , / /t h a tc o n t a i ni s o t o p ev a l u e sf o rt h es e l e c t e de l e m e n t . e l e m e n t D S . R e l a t i o n s . A d d ( " I s o t o p e s " , e l e m e n t D S . T a b l e s [ " E l e m e n t s " ] . C o l u m n s [ " A t o m i cN u m b e r " ] , e l e m e n t D S . T a b l e s [ " I s o t o p e s " ] . C o l u m n s [ " A t o m i cN u m b e r " ]) ;

4.5 Linked tables in a dataset


4.5.1 Filling
Assume that another DataSet ds exists that has a table with index 0 in its Tables collection that contains both Element and Isotope data that will be used to fill rows in the linked tables contained in the elementDS DataSet tables collection as defined in the previous section. Assume Table[0] in DataSet ds has the following columns: AtomicNbr, Element, Symbol, IsotopeNbr, PctAbundance and AtomicMass where rows are sorted by Atomic numbers ascending and then by IsotopeNbr numbers ascending.
Collapse | Copy Code

/ /A s s i g nt h et a b l ec o n t a i n i n gb o t hE l e m e n t sa n d / /I s o t o p e st od tu s i n gi n d e x0 D a t a T a b l ed t=d s . T a b l e s [ 0 ] ; / /C r e a t et w oD a t a T a b l ev a r i a b l e sd t E l e m e n t sa n dd t I s o t o p e sa n d / /a s s i g nt a b l e sc o n t a i n e di nt h eD a t a S e te l e m e n t D ST a b l e s / /c o l l e c t i o nu s i n gT a b l e N a m e sa si n d e x e s . D a t a T a b l ed t E l e m e n t s=e l e m e n t D S . T a b l e s [ E l e m e n t s ] ; D a t a T a b l ed t I s o t o p e s=e l e m e n t D S . T a b l e s [ I s o t o p e s ] ; D a t a R o wd r E l e m e n t ; D a t a R o wd r I s o t o p e ; i n tp r e v A t o m i c N b r=0 ; f o r e a c h( D a t a R o wd ri nd t . R o w s ) { i f ( p r e v A t o m i c N b r! =( i n t ) d r [ " A t o m i c N b r " ] ) {/ / n e e do n l yo n er o wp e rA t o m i c N b ri nT a b l e [ E l e m e n t s ] / /F i l la ne l e m e n tr o ww i t hd a t af r o md t . p r e v A t o m i c N b r=( i n t ) d r [ " A t o m i c N b r " ] ; d r E l e m e n t=d t E l e m e n t s . N e w R o w ( ) ; d r E l e m e n t [ " A t o m i cN u m b e r " ]=d r [ " A t o m i c N b r " ] ; d r E l e m e n t [ " E l e m e n t " ]=d r [ " E l e m e n t " ] ; d r E l e m e n t [ " S y m b o l " ]=d r [ " S y m b o l " ] ; d t E l e m e n t s . R o w s . A d d ( d r E l e m e n t ) ;

www.codeproject.com/Articles/6180/A-Practical-Guide-to-NET-DataTables-DataSets-and-D

5/9

1/20/14

A Practical Guide to .NET DataTables, DataSets and DataGrids - Part 3 - CodeProject


} / /F i l la ni s o t o p er o ww i t hd a t af r o md t . d r I s o t o p e=d t I s o t o p e s . N e w R o w ( ) ; d r I s o t o p e [ " I s o t o p eN u m b e r " ]=d r [ " I s o t o p e N b r " ] ; d r I s o t o p e [ " S y m b o l " ]=d r [ " S y m b o l " ] ; d r I s o t o p e [ " A t o m i cN u m b e r " ]=d r [ " A t o m i c N b r " ] ; d r I s o t o p e [ " P e r c e n tA b u n d a n c e " ]=d r [ " P c t A b u n d a n c e " ] ; d r I s o t o p e [ " A t o m i cM a s s " ]=d r [ " A t o m i c M a s s " ] ; d t I s o t o p e s . R o w s . A d d ( d r I s o t o p e ) ;

4.5.2 Removing
To remove all linked tables or a selected table that is linked from the D a t a S e t , it is first necessary to remove all relations, then constraints and then the table otherwise relationship/constraint table errors are generated. The following code example provides a generic routine for removing all linked tables in a dataset.
Collapse | Copy Code

p u b l i cv o i dR e m o v e A l l T a b l e s ( D a t a S e td s ) { / /n e e dt od oi ti nr e v e r s eo r d e rd u et oc o n s t r a i n t s d s . R e l a t i o n s . C l e a r ( ) ; f o r( i n ti = d s . T a b l e s . C o u n t1 ;i> = 0 ;i ) { d s . T a b l e s [ i ] . C o n s t r a i n t s . C l e a r ( ) ; d s . T a b l e s . R e m o v e A t ( i ) ; } }

4.6 XML Export and Import DataSet Data


4.6.1 W r i t e X m l
All tables with their schemas, relationships, constraints and data contained in a DataSet can be exported in XML by specifying a DataSet property Namespace and using the W r i t e X m lmethod. For example:
Collapse | Copy Code

d s . N a m e s p a c e=" h t t p : / / w w w . m y d o m a i n . c o m / x m l f i l e s d s . W r i t e X m l ( F i l e N a m e ,X m l W r i t e M o d e . W r i t e S c h e m a ) ;

4.6.2 R e a d X m l
All tables with their schemas, relationships, constraints and data contained in an XML file are imported into a DataSet by specifying a DataSet property Namespace and using the R e a d X m lmethod. Once in the D a t a S e tit is just like any other dataset. For example:
Collapse | Copy Code

D a t a S e td s=n e wD a t a S e t ( ) ; d s . N a m e s p a c e=" h t t p : / / w w w . m y d o m a i n . c o m / x m l f i l e s " ; d s . R e a d X m l ( F i l e N a m e ,X m l R e a d M o d e . R e a d S c h e m a ) ;

4.7 Handling DataSet Errors


Similar to the DataTable H a s E r r o r s property the DataSet H a s E r r o r sproperty returns true if any errors occurred in any of the tables being managed by the DataSet.
Collapse | Copy Code

i f ( d s . H a s E r r o r s ) {/ /O n eo rm o r eo ft h et a b l e si nt h eD a t a S e th a se r r o r s . M e s s a g e B o x . S h o w ( " D a t a S e th a sE r r o r s " ) ; / /I n s e r tc o d et or e s o l v ee r r o r s . / /R e f e rt o H a n d l i n gD a t a T a b l eE r r o r s s e c t i o nf o re x a m p l eo f / /h a n d l i n ge r r o r sw i t h i nt a b l e s . }

www.codeproject.com/Articles/6180/A-Practical-Guide-to-NET-DataTables-DataSets-and-D

6/9

1/20/14

A Practical Guide to .NET DataTables, DataSets and DataGrids - Part 3 - CodeProject

4.8 Updating Database with DataSet/DataTable changes


The following code shows how to create a DataSet containing all of the changes that have occurred to tables within a DataSet. The new DataSet can be used for updating the database.
Collapse | Copy Code

/ /C r e a t et e m p o r a r yD a t a S e tv a r i a b l e . D a t a S e td s C h a n g e s ; / /G e t C h a n g e sf o rm o d i f i e dr o w so n l y . d s C h a n g e s=d s . G e t C h a n g e s ( D a t a R o w S t a t e . M o d i f i e d ) ; / /C h e c kt h eD a t a S e tf o re r r o r s . i f ( ! d s C h a n g e s . H a s E r r o r s ) { / /N oe r r o r sw e r ef o u n d ,u p d a t et h eD B M Sw i t ht h eS q l D a t a A d a p t e rd a / /u s e dt oc r e a t et h eD a t a S e t . d a . R o w U p d a t i n g+ =n e wS q l R o w U p d a t i n g E v e n t H a n d l e r ( O n R o w U p d a t i n g ) ; d a . R o w U p d a t e d+ =n e wS q l R o w U p d a t e d E v e n t H a n d l e r ( O n R o w U p d a t e d ) ; i n tr e s=d a . U p d a t e ( d s C h a n g e s ) ;/ /r e t u r n st h en u m b e ro fr o w su p d a t e d d a . R o w U p d a t i n g=n e wS q l R o w U p d a t i n g E v e n t H a n d l e r ( O n R o w U p d a t i n g ) ; d a . R o w U p d a t e d=n e wS q l R o w U p d a t e d E v e n t H a n d l e r ( O n R o w U p d a t e d ) ; }

Next
Data Grids

License
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below. A list of licenses authors might use can be found here

About the Author

Pete2004
President Bioxing United States Ph.D. in BioPhysics and over 20 years of experience in managing, architecting and hands-on developing software systems for biotechnology companies that produced cutting edge instrumentation and data systems. These include DNA and Peptide Synthesizers, cDNA, oligo and Protein microarrays and mass spectrometers used for protein sequencing.In 2001 founded BioXing (pronounced Bio-Crossing) which has architected and developed an extensible relational database repository and software system that includes Web Services, Client Workstation and Web Based applications. The system is used to track, manage, integrate and data mine disparate laboratory data, protocols and experiments and link to reference proteomic and genomic data. BioXing also does consulting and development for biotechnology companies. Article Top

www.codeproject.com/Articles/6180/A-Practical-Guide-to-NET-DataTables-DataSets-and-D

7/9

1/20/14

A Practical Guide to .NET DataTables, DataSets and DataGrids - Part 3 - CodeProject

Comments and Discussions


You must Sign In to use this message board. Search this forum Profile popups Spacing Relaxed Noise Very High Layout Normal Per page 50 Go Update

First Prev Next

My vote of 5 Good article but unnecessary complex [Message Removed] Re: Good article but unnecessary complex Updating Dataset Problems Re: Updating Dataset Problems Re: Updating Dataset Problems Re: Updating Dataset Problems [modified] Re: Updating Dataset Problems how read a xml with dataset class Re: how read a xml with dataset class InsertAt() causes errors Re: InsertAt() causes errors conversion excel file into txt file WriteXML and blob Re: WriteXML and blob Programatic DataGrid Scrolling Re: Programatic DataGrid Scrolling Re: Programatic DataGrid Scrolling Re: Programatic DataGrid Scrolling ReadXML and datagrid Re: ReadXML and datagrid A problem with WriteXml Re: A problem with WriteXml Re: A problem with WriteXml Changing Column Order Re: Changing Column Order Re: Changing Column Order Re: Changing Column Order Re: Changing Column Order Re: Changing Column Order

Bolud pentel immetoz Pete2004 HinJinShah Pete2004 HinJinShah Pete2004 HinJinShah rjorget DharmarajNagarajan Mr.Bill Pete2004 Miroka Holger Flick Pete2004

13-Aug-10 12:14 27-Aug-08 19:45 4-Oct-08 2:02 6-Oct-08 6:04 1-Aug-07 5:50 1-Aug-07 6:04 3-Aug-07 9:38 4-Aug-07 14:56 8-Aug-07 6:43 2-Feb-06 8:13 13-Nov-07 23:18 16-Aug-05 2:13 17-Aug-05 10:45 8-Jun-05 7:06 31-Jul-04 13:21 17-Aug-05 10:48 10-Jul-04 9:00 10-Jul-04 13:09 15-Jul-04 19:32 15-Jul-04 6:34 28-May-04 11:34 28-May-04 12:07 17-May-04 6:27 17-May-04 7:08 17-May-04 11:18 4-May-04 3:32 5-May-04 4:33 5-May-04 4:40 5-May-04 5:40 5-May-04 5:45 5-May-04 5:55

Anonymous
partyganger

Anonymous
Pete2004

Anonymous
Pete2004 sjkdo Pete2004 sjkdo EstimatedProphet Pete2004 EstimatedProphet Pete2004 EstimatedProphet Pete2004

www.codeproject.com/Articles/6180/A-Practical-Guide-to-NET-DataTables-DataSets-and-D

8/9

1/20/14

A Practical Guide to .NET DataTables, DataSets and DataGrids - Part 3 - CodeProject


Re: Changing Column Order Re: Changing Column Order Re: One Solution for Changing Column Order Very useful article. Re: Very useful article. Re: Very useful article. Link your articles together? Re: Link your articles together?
Last Visit: 31-Dec-99 18:00 General News Last Update: 19-Jan-14 21:51 Suggestion Question Bug Answer Joke Rant Mike Osbahr 27-Jul-04 10:55 9-Aug-04 12:56 1-Nov-05 6:26 29-Apr-04 2:15 29-Apr-04 8:03 30-Apr-04 15:03 25-Feb-04 5:15 29-Apr-04 12:19 Refresh Admin 1

Anonymous
dothedew Boyan Botev Pete2004 Pete2004 MikeBeard Pete2004

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
Permalink | Advertise | Privacy | Mobile Web02 | 2.8.140119.1 | Last Updated 24 Feb 2004 Layout: fixed | fluid Article Copyright 2004 by Pete2004 Everything else Copyright CodeProject, 1999-2014 Terms of Use

www.codeproject.com/Articles/6180/A-Practical-Guide-to-NET-DataTables-DataSets-and-D

9/9

Das könnte Ihnen auch gefallen