DataSetHelper——操作DataSet的工具类

本文介绍了一个用于操作DataSet的辅助类,该类提供了多种方法来处理数据表,如选择不重复的记录、创建新表、进行分组操作及连接表等。通过对这些方法的详细解析,帮助读者更好地理解和使用此类。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转自风满袖的Blog http://jiezhi.cnblogs.com/archive/2005/01/05/86838.html

  1 None.gif using  System; 
  2 None.gif using  System.Collections; 
  3 None.gif using  System.Data; 
  4 None.gif 
  5 None.gif namespace  Common 
  6 ExpandedBlockStart.gifContractedBlock.gif dot.gif
  7ExpandedSubBlockStart.gifContractedSubBlock.gif    /**//**//**//// <summary> 
  8InBlock.gif    /// DataSet助手 
  9ExpandedSubBlockEnd.gif    /// </summary> 

 10InBlock.gif    public class DataSetHelper 
 11ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif
 12InBlock.gif        private class FieldInfo 
 13ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
 14InBlock.gif            public string RelationName; 
 15InBlock.gif            public string FieldName; 
 16InBlock.gif            public string FieldAlias; 
 17InBlock.gif            public string Aggregate; 
 18ExpandedSubBlockEnd.gif        }
 
 19InBlock.gif 
 20InBlock.gif        private DataSet ds; 
 21InBlock.gif        private ArrayList m_FieldInfo; 
 22InBlock.gif        private string m_FieldList; 
 23InBlock.gif        private ArrayList GroupByFieldInfo; 
 24InBlock.gif        private string GroupByFieldList; 
 25InBlock.gif 
 26InBlock.gif        public DataSet DataSet 
 27ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
 28ExpandedSubBlockStart.gifContractedSubBlock.gif            get dot.gifreturn ds; } 
 29ExpandedSubBlockEnd.gif        }
 
 30InBlock.gif 
 31ContractedSubBlock.gifExpandedSubBlockStart.gif        构造方法#region  构造方法 
 32InBlock.gif 
 33InBlock.gif        public DataSetHelper() 
 34ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
 35InBlock.gif            ds = null
 36ExpandedSubBlockEnd.gif        }

 37InBlock.gif 
 38InBlock.gif        public DataSetHelper(ref DataSet dataSet) 
 39ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
 40InBlock.gif            ds = dataSet; 
 41ExpandedSubBlockEnd.gif        }
 
 42InBlock.gif 
 43ExpandedSubBlockEnd.gif        #endregion
 
 44InBlock.gif 
 45ContractedSubBlock.gifExpandedSubBlockStart.gif        私有方法#region 私有方法 
 46InBlock.gif 
 47ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 48InBlock.gif        /// 比较两列
 49InBlock.gif        /// </summary>
 50InBlock.gif        /// <param name="objectA"></param>
 51InBlock.gif        /// <param name="objectB"></param>
 52ExpandedSubBlockEnd.gif        /// <returns></returns>

 53InBlock.gif        private bool ColumnEqual(object objectA, object objectB) 
 54ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
 55InBlock.gif            if ( objectA == DBNull.Value && objectB == DBNull.Value ) 
 56ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
 57InBlock.gif                return true
 58ExpandedSubBlockEnd.gif            }
 
 59InBlock.gif            if ( objectA == DBNull.Value || objectB == DBNull.Value ) 
 60ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
 61InBlock.gif                return false
 62ExpandedSubBlockEnd.gif            }
 
 63InBlock.gif            return ( objectA.Equals( objectB ) ); 
 64ExpandedSubBlockEnd.gif        }
 
 65InBlock.gif 
 66ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 67InBlock.gif        /// 比较两行
 68InBlock.gif        /// </summary>
 69InBlock.gif        /// <param name="rowA">A表的行</param>
 70InBlock.gif        /// <param name="rowB">B表的行</param>
 71InBlock.gif        /// <param name="columns">所对应的列</param>
 72ExpandedSubBlockEnd.gif        /// <returns></returns>

 73InBlock.gif        private bool RowEqual(DataRow rowA, DataRow rowB, DataColumnCollection columns) 
 74ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
 75InBlock.gif            bool result = true
 76InBlock.gif            for ( int i = 0; i < columns.Count; i++ ) 
 77ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
 78InBlock.gif                result &= ColumnEqual( rowA[ columns[ i ].ColumnName ], rowB[ columns[ i ].ColumnName ] ); 
 79ExpandedSubBlockEnd.gif            }
 
 80InBlock.gif            return result; 
 81ExpandedSubBlockEnd.gif        }
 
 82InBlock.gif 
 83ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 84InBlock.gif        /// 暂时不知道
 85InBlock.gif        /// </summary>
 86InBlock.gif        /// <param name="fieldList"></param>
 87ExpandedSubBlockEnd.gif        /// <param name="allowRelation"></param>

 88InBlock.gif        private void ParseFieldList(string fieldList, bool allowRelation) 
 89ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
 90InBlock.gif            if ( m_FieldList == fieldList ) 
 91ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
 92InBlock.gif                return
 93ExpandedSubBlockEnd.gif            }
 
 94InBlock.gif            m_FieldInfo = new ArrayList(); 
 95InBlock.gif            m_FieldList = fieldList; 
 96InBlock.gif            FieldInfo Field; 
 97InBlock.gif            string[] FieldParts; 
 98InBlock.gif            string[] Fields = fieldList.Split( ',' ); 
 99InBlock.gif            for ( int i = 0; i <= Fields.Length - 1; i++ ) 
100ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
101InBlock.gif                Field = new FieldInfo(); 
102InBlock.gif                FieldParts = Fields[ i ].Trim().Split( ' ' ); 
103InBlock.gif                switch ( FieldParts.Length ) 
104ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
105InBlock.gif                    case 1
106InBlock.gif                        //to be set at the end of the loop 
107InBlock.gif                        break
108InBlock.gif                    case 2
109InBlock.gif                        Field.FieldAlias = FieldParts[ 1 ]; 
110InBlock.gif                        break
111InBlock.gif                    default
112InBlock.gif                        return
113ExpandedSubBlockEnd.gif                }
 
114InBlock.gif                FieldParts = FieldParts[ 0 ].Split( '.' ); 
115InBlock.gif                switch ( FieldParts.Length ) 
116ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
117InBlock.gif                    case 1
118InBlock.gif                        Field.FieldName = FieldParts[ 0 ]; 
119InBlock.gif                        break
120InBlock.gif                    case 2
121InBlock.gif                        if ( allowRelation == false ) 
122ExpandedSubBlockStart.gifContractedSubBlock.gif                        dot.gif
123InBlock.gif                            return
124ExpandedSubBlockEnd.gif                        }
 
125InBlock.gif                        Field.RelationName = FieldParts[ 0 ].Trim(); 
126InBlock.gif                        Field.FieldName = FieldParts[ 1 ].Trim(); 
127InBlock.gif                        break
128InBlock.gif                    default
129InBlock.gif                        return
130ExpandedSubBlockEnd.gif                }
 
131InBlock.gif                if ( Field.FieldAlias == null ) 
132ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
133InBlock.gif                    Field.FieldAlias = Field.FieldName; 
134ExpandedSubBlockEnd.gif                }
 
135InBlock.gif                m_FieldInfo.Add( Field ); 
136ExpandedSubBlockEnd.gif            }
 
137ExpandedSubBlockEnd.gif        }
 
138InBlock.gif 
139ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
140InBlock.gif        /// 创建DataTable
141InBlock.gif        /// </summary>
142InBlock.gif        /// <param name="tableName">表名</param>
143InBlock.gif        /// <param name="sourceTable">源表</param>
144InBlock.gif        /// <param name="fieldList"></param>
145ExpandedSubBlockEnd.gif        /// <returns></returns>

146InBlock.gif        private DataTable CreateTable(string tableName, DataTable sourceTable, string fieldList) 
147ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
148InBlock.gif            DataTable dt; 
149InBlock.gif            if ( fieldList.Trim() == "" ) 
150ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
151InBlock.gif                dt = sourceTable.Clone(); 
152InBlock.gif                dt.TableName = tableName; 
153ExpandedSubBlockEnd.gif            }
 
154InBlock.gif            else 
155ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
156InBlock.gif                dt = new DataTable( tableName ); 
157InBlock.gif                ParseFieldList( fieldList, false ); 
158InBlock.gif                DataColumn dc; 
159InBlock.gif                foreach ( FieldInfo Field in m_FieldInfo ) 
160ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
161InBlock.gif                    dc = sourceTable.Columns[ Field.FieldName ]; 
162InBlock.gif                    DataColumn column = new DataColumn(); 
163InBlock.gif                    column.ColumnName = Field.FieldAlias; 
164InBlock.gif                    column.DataType = dc.DataType; 
165InBlock.gif                    column.MaxLength = dc.MaxLength; 
166InBlock.gif                    column.Expression = dc.Expression; 
167InBlock.gif                    dt.Columns.Add( column ); 
168ExpandedSubBlockEnd.gif                }
 
169ExpandedSubBlockEnd.gif            }
 
170InBlock.gif            if ( ds != null ) 
171ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
172InBlock.gif                ds.Tables.Add( dt ); 
173ExpandedSubBlockEnd.gif            }
 
174InBlock.gif            return dt; 
175ExpandedSubBlockEnd.gif        }
 
176InBlock.gif 
177ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
178InBlock.gif        /// 插入表
179InBlock.gif        /// </summary>
180InBlock.gif        /// <param name="destTable">DataTable</param>
181InBlock.gif        /// <param name="sourceTable">源DataTable</param>
182InBlock.gif        /// <param name="fieldList"></param>
183InBlock.gif        /// <param name="rowFilter"></param>
184ExpandedSubBlockEnd.gif        /// <param name="sort"></param>

185InBlock.gif        private void InsertInto(DataTable destTable, DataTable sourceTable, 
186InBlock.gif            string fieldList, string rowFilter, string sort) 
187ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
188InBlock.gif            ParseFieldList( fieldList, false ); 
189InBlock.gif            DataRow[] rows = sourceTable.Select( rowFilter, sort ); 
190InBlock.gif            DataRow destRow; 
191InBlock.gif            foreach ( DataRow sourceRow in rows ) 
192ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
193InBlock.gif                destRow = destTable.NewRow(); 
194InBlock.gif                if ( fieldList == "" ) 
195ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
196InBlock.gif                    foreach ( DataColumn dc in destRow.Table.Columns ) 
197ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
198InBlock.gif                        if ( dc.Expression == "" ) 
199ExpandedSubBlockStart.gifContractedSubBlock.gif                        dot.gif
200InBlock.gif                            destRow[ dc ] = sourceRow[ dc.ColumnName ]; 
201ExpandedSubBlockEnd.gif                        }
 
202ExpandedSubBlockEnd.gif                    }
 
203ExpandedSubBlockEnd.gif                }
 
204InBlock.gif                else 
205ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
206InBlock.gif                    foreach ( FieldInfo field in m_FieldInfo ) 
207ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
208InBlock.gif                        destRow[ field.FieldAlias ] = sourceRow[ field.FieldName ]; 
209ExpandedSubBlockEnd.gif                    }
 
210ExpandedSubBlockEnd.gif                }
 
211InBlock.gif                destTable.Rows.Add( destRow ); 
212ExpandedSubBlockEnd.gif            }
 
213ExpandedSubBlockEnd.gif        }
 
214InBlock.gif 
215ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
216InBlock.gif        /// 暂时不知道
217InBlock.gif        /// </summary>
218ExpandedSubBlockEnd.gif        /// <param name="FieldList"></param>

219InBlock.gif        private void ParseGroupByFieldList(string FieldList) 
220ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
221InBlock.gif            if ( GroupByFieldList == FieldList ) 
222ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
223InBlock.gif                return
224ExpandedSubBlockEnd.gif            }
 
225InBlock.gif            GroupByFieldInfo = new ArrayList(); 
226InBlock.gif            FieldInfo Field; 
227InBlock.gif            string[] FieldParts; 
228InBlock.gif            string[] Fields = FieldList.Split( ',' ); 
229InBlock.gif            for ( int i = 0; i <= Fields.Length - 1; i++ ) 
230ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
231InBlock.gif                Field = new FieldInfo(); 
232InBlock.gif                FieldParts = Fields[ i ].Trim().Split( ' ' ); 
233InBlock.gif                switch ( FieldParts.Length ) 
234ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
235InBlock.gif                    case 1
236InBlock.gif                        //to be set at the end of the loop 
237InBlock.gif                        break
238InBlock.gif                    case 2
239InBlock.gif                        Field.FieldAlias = FieldParts[ 1 ]; 
240InBlock.gif                        break
241InBlock.gif                    default
242InBlock.gif                        return
243ExpandedSubBlockEnd.gif                }
 
244InBlock.gif 
245InBlock.gif                FieldParts = FieldParts[ 0 ].Split( '(' ); 
246InBlock.gif                switch ( FieldParts.Length ) 
247ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
248InBlock.gif                    case 1
249InBlock.gif                        Field.FieldName = FieldParts[ 0 ]; 
250InBlock.gif                        break
251InBlock.gif                    case 2
252InBlock.gif                        Field.Aggregate = FieldParts[ 0 ].Trim().ToLower(); 
253InBlock.gif                        Field.FieldName = FieldParts[ 1 ].Trim( ' '')' ); 
254InBlock.gif                        break
255InBlock.gif                    default
256InBlock.gif                        return
257ExpandedSubBlockEnd.gif                }
 
258InBlock.gif                if ( Field.FieldAlias == null ) 
259ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
260InBlock.gif                    if ( Field.Aggregate == null ) 
261ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
262InBlock.gif                        Field.FieldAlias = Field.FieldName; 
263ExpandedSubBlockEnd.gif                    }
 
264InBlock.gif                    else 
265ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
266InBlock.gif                        Field.FieldAlias = Field.Aggregate + "of" + Field.FieldName; 
267ExpandedSubBlockEnd.gif                    }
 
268ExpandedSubBlockEnd.gif                }
 
269InBlock.gif                GroupByFieldInfo.Add( Field ); 
270ExpandedSubBlockEnd.gif            }
 
271InBlock.gif            GroupByFieldList = FieldList; 
272ExpandedSubBlockEnd.gif        }
 
273InBlock.gif 
274ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
275InBlock.gif        /// 创建一个分组DataTable
276InBlock.gif        /// </summary>
277InBlock.gif        /// <param name="tableName">表名</param>
278InBlock.gif        /// <param name="sourceTable">DataTable</param>
279InBlock.gif        /// <param name="fieldList">分组字段</param>
280ExpandedSubBlockEnd.gif        /// <returns></returns>

281InBlock.gif        private DataTable CreateGroupByTable(string tableName, DataTable sourceTable, string fieldList) 
282ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
283InBlock.gif            if ( fieldList == null || fieldList.Length == 0 ) 
284ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
285InBlock.gif                return sourceTable.Clone(); 
286ExpandedSubBlockEnd.gif            }
 
287InBlock.gif            else 
288ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
289InBlock.gif                DataTable dt = new DataTable( tableName ); 
290InBlock.gif                ParseGroupByFieldList( fieldList ); 
291InBlock.gif                foreach ( FieldInfo Field in GroupByFieldInfo ) 
292ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
293InBlock.gif                    DataColumn dc = sourceTable.Columns[ Field.FieldName ]; 
294InBlock.gif                    if ( Field.Aggregate == null ) 
295ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
296InBlock.gif                        dt.Columns.Add( Field.FieldAlias, dc.DataType, dc.Expression ); 
297ExpandedSubBlockEnd.gif                    }
 
298InBlock.gif                    else 
299ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
300InBlock.gif                        dt.Columns.Add( Field.FieldAlias, dc.DataType ); 
301ExpandedSubBlockEnd.gif                    }
 
302ExpandedSubBlockEnd.gif                }
 
303InBlock.gif                if ( ds != null ) 
304ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
305InBlock.gif                    ds.Tables.Add( dt ); 
306ExpandedSubBlockEnd.gif                }
 
307InBlock.gif                return dt; 
308ExpandedSubBlockEnd.gif            }
 
309ExpandedSubBlockEnd.gif        }
 
310InBlock.gif 
311InBlock.gif        private void InsertGroupByInto(DataTable destTable, DataTable sourceTable, string fieldList, 
312InBlock.gif            string rowFilter, string groupBy) 
313ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
314InBlock.gif            if ( fieldList == null || fieldList.Length == 0 ) 
315ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
316InBlock.gif                return
317ExpandedSubBlockEnd.gif            }
 
318InBlock.gif            ParseGroupByFieldList( fieldList );  
319InBlock.gif            ParseFieldList( groupBy, false );  
320InBlock.gif            DataRow[] rows = sourceTable.Select( rowFilter, groupBy ); 
321InBlock.gif            DataRow lastSourceRow = null, destRow = null
322InBlock.gif            bool sameRow; 
323InBlock.gif            int rowCount = 0
324InBlock.gif            foreach ( DataRow sourceRow in rows ) 
325ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
326InBlock.gif                sameRow = false
327InBlock.gif                if ( lastSourceRow != null ) 
328ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
329InBlock.gif                    sameRow = true
330InBlock.gif                    foreach ( FieldInfo Field in m_FieldInfo ) 
331ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
332InBlock.gif                        if ( !ColumnEqual( lastSourceRow[ Field.FieldName ], sourceRow[ Field.FieldName ] ) ) 
333ExpandedSubBlockStart.gifContractedSubBlock.gif                        dot.gif
334InBlock.gif                            sameRow = false
335InBlock.gif                            break
336ExpandedSubBlockEnd.gif                        }
 
337ExpandedSubBlockEnd.gif                    }
 
338InBlock.gif                    if ( !sameRow ) 
339ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
340InBlock.gif                        destTable.Rows.Add( destRow ); 
341ExpandedSubBlockEnd.gif                    }
 
342ExpandedSubBlockEnd.gif                }
 
343InBlock.gif                if ( !sameRow ) 
344ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
345InBlock.gif                    destRow = destTable.NewRow(); 
346InBlock.gif                    rowCount = 0
347ExpandedSubBlockEnd.gif                }
 
348InBlock.gif                rowCount += 1
349InBlock.gif                foreach ( FieldInfo field in GroupByFieldInfo ) 
350ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
351InBlock.gif                    switch ( field.Aggregate.ToLower() ) 
352ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
353InBlock.gif                        case null:  
354InBlock.gif                        case ""
355InBlock.gif                        case "last"
356InBlock.gif                            destRow[ field.FieldAlias ] = sourceRow[ field.FieldName ]; 
357InBlock.gif                            break
358InBlock.gif                        case "first"
359InBlock.gif                            if ( rowCount == 1 ) 
360ExpandedSubBlockStart.gifContractedSubBlock.gif                            dot.gif
361InBlock.gif                                destRow[ field.FieldAlias ] = sourceRow[ field.FieldName ]; 
362ExpandedSubBlockEnd.gif                            }
 
363InBlock.gif                            break
364InBlock.gif                        case "count"
365InBlock.gif                            destRow[ field.FieldAlias ] = rowCount; 
366InBlock.gif                            break
367InBlock.gif                        case "sum"
368InBlock.gif                            destRow[ field.FieldAlias ] = Add( destRow[ field.FieldAlias ], sourceRow[ field.FieldName ] ); 
369InBlock.gif                            break
370InBlock.gif                        case "max"
371InBlock.gif                            destRow[ field.FieldAlias ] = Max( destRow[ field.FieldAlias ], sourceRow[ field.FieldName ] ); 
372InBlock.gif                            break
373InBlock.gif                        case "min"
374InBlock.gif                            if ( rowCount == 1 ) 
375ExpandedSubBlockStart.gifContractedSubBlock.gif                            dot.gif
376InBlock.gif                                destRow[ field.FieldAlias ] = sourceRow[ field.FieldName ]; 
377ExpandedSubBlockEnd.gif                            }
 
378InBlock.gif                            else 
379ExpandedSubBlockStart.gifContractedSubBlock.gif                            dot.gif
380InBlock.gif                                destRow[ field.FieldAlias ] = Min( destRow[ field.FieldAlias ], sourceRow[ field.FieldName ] ); 
381ExpandedSubBlockEnd.gif                            }
 
382InBlock.gif                            break
383ExpandedSubBlockEnd.gif                    }
 
384ExpandedSubBlockEnd.gif                }
 
385InBlock.gif                lastSourceRow = sourceRow; 
386ExpandedSubBlockEnd.gif            }
 
387InBlock.gif            if ( destRow != null ) 
388ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
389InBlock.gif                destTable.Rows.Add( destRow ); 
390ExpandedSubBlockEnd.gif            }
 
391ExpandedSubBlockEnd.gif        }
 
392InBlock.gif 
393InBlock.gif        private object Min(object a, object b) 
394ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
395InBlock.gif            if ( ( a is DBNull ) || ( b is DBNull ) ) 
396ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
397InBlock.gif                return DBNull.Value; 
398ExpandedSubBlockEnd.gif            }
 
399InBlock.gif            if ( ( (IComparable) a ).CompareTo( b ) == -1 ) 
400ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
401InBlock.gif                return a; 
402ExpandedSubBlockEnd.gif            }
 
403InBlock.gif            else 
404ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
405InBlock.gif                return b; 
406ExpandedSubBlockEnd.gif            }
 
407ExpandedSubBlockEnd.gif        }
 
408InBlock.gif 
409InBlock.gif        private object Max(object a, object b) 
410ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
411InBlock.gif            if ( a is DBNull ) 
412ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
413InBlock.gif                return b; 
414ExpandedSubBlockEnd.gif            }
 
415InBlock.gif            if ( b is DBNull ) 
416ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
417InBlock.gif                return a; 
418ExpandedSubBlockEnd.gif            }
 
419InBlock.gif            if ( ( (IComparable) a ).CompareTo( b ) == 1 ) 
420ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
421InBlock.gif                return a; 
422ExpandedSubBlockEnd.gif            }
 
423InBlock.gif            else 
424ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
425InBlock.gif                return b; 
426ExpandedSubBlockEnd.gif            }
 
427ExpandedSubBlockEnd.gif        }
 
428InBlock.gif 
429InBlock.gif        private object Add(object a, object b) 
430ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
431InBlock.gif            if ( a is DBNull ) 
432ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
433InBlock.gif                return b; 
434ExpandedSubBlockEnd.gif            }
 
435InBlock.gif            if ( b is DBNull ) 
436ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
437InBlock.gif                return a; 
438ExpandedSubBlockEnd.gif            }
 
439InBlock.gif            return ( (decimal) a + (decimal) b ); 
440ExpandedSubBlockEnd.gif        }
 
441InBlock.gif 
442InBlock.gif        private DataTable CreateJoinTable(string tableName, DataTable sourceTable, string fieldList) 
443ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
444InBlock.gif            if ( fieldList == null ) 
445ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
446InBlock.gif                return sourceTable.Clone(); 
447ExpandedSubBlockEnd.gif            }
 
448InBlock.gif            else 
449ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
450InBlock.gif                DataTable dt = new DataTable( tableName ); 
451InBlock.gif                ParseFieldList( fieldList, true ); 
452InBlock.gif                foreach ( FieldInfo field in m_FieldInfo ) 
453ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
454InBlock.gif                    if ( field.RelationName == null ) 
455ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
456InBlock.gif                        DataColumn dc = sourceTable.Columns[ field.FieldName ]; 
457InBlock.gif                        dt.Columns.Add( dc.ColumnName, dc.DataType, dc.Expression ); 
458ExpandedSubBlockEnd.gif                    }
 
459InBlock.gif                    else 
460ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
461InBlock.gif                        DataColumn dc = sourceTable.ParentRelations[ field.RelationName ].ParentTable.Columns[ field.FieldName ]; 
462InBlock.gif                        dt.Columns.Add( dc.ColumnName, dc.DataType, dc.Expression ); 
463ExpandedSubBlockEnd.gif                    }
 
464ExpandedSubBlockEnd.gif                }
 
465InBlock.gif                if ( ds != null ) 
466ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
467InBlock.gif                    ds.Tables.Add( dt ); 
468ExpandedSubBlockEnd.gif                }
 
469InBlock.gif                return dt; 
470ExpandedSubBlockEnd.gif            }
 
471ExpandedSubBlockEnd.gif        }
 
472InBlock.gif 
473InBlock.gif        private void InsertJoinInto(DataTable destTable, DataTable sourceTable, 
474InBlock.gif            string fieldList, string rowFilter, string sort) 
475ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
476InBlock.gif            if ( fieldList == null ) 
477ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
478InBlock.gif                return
479ExpandedSubBlockEnd.gif            }
 
480InBlock.gif            else 
481ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
482InBlock.gif                ParseFieldList( fieldList, true ); 
483InBlock.gif                DataRow[] Rows = sourceTable.Select( rowFilter, sort ); 
484InBlock.gif                foreach ( DataRow SourceRow in Rows ) 
485ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
486InBlock.gif                    DataRow DestRow = destTable.NewRow(); 
487InBlock.gif                    foreach ( FieldInfo Field in m_FieldInfo ) 
488ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
489InBlock.gif                        if ( Field.RelationName == null ) 
490ExpandedSubBlockStart.gifContractedSubBlock.gif                        dot.gif
491InBlock.gif                            DestRow[ Field.FieldName ] = SourceRow[ Field.FieldName ]; 
492ExpandedSubBlockEnd.gif                        }
 
493InBlock.gif                        else 
494ExpandedSubBlockStart.gifContractedSubBlock.gif                        dot.gif
495InBlock.gif                            DataRow ParentRow = SourceRow.GetParentRow( Field.RelationName ); 
496InBlock.gif                            DestRow[ Field.FieldName ] = ParentRow[ Field.FieldName ]; 
497ExpandedSubBlockEnd.gif                        }
 
498ExpandedSubBlockEnd.gif                    }
 
499InBlock.gif                    destTable.Rows.Add( DestRow ); 
500ExpandedSubBlockEnd.gif                }
 
501ExpandedSubBlockEnd.gif            }
 
502ExpandedSubBlockEnd.gif        }
 
503InBlock.gif 
504ExpandedSubBlockEnd.gif        #endregion
 
505InBlock.gif 
506ContractedSubBlock.gifExpandedSubBlockStart.gif        SelectDistinct / Distinct#region SelectDistinct / Distinct 
507InBlock.gif 
508ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//**//**//// <summary> 
509InBlock.gif        /// 按照fieldName从sourceTable中选择出不重复的行, 
510InBlock.gif        /// 相当于select distinct fieldName from sourceTable 
511InBlock.gif        /// </summary> 
512InBlock.gif        /// <param name="tableName">表名</param> 
513InBlock.gif        /// <param name="sourceTable">源DataTable</param> 
514InBlock.gif        /// <param name="fieldName">列名</param> 
515ExpandedSubBlockEnd.gif        /// <returns>一个新的不含重复行的DataTable,列只包括fieldName指明的列</returns> 

516InBlock.gif        public DataTable SelectDistinct(string tableName, DataTable sourceTable, string fieldName) 
517ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
518InBlock.gif            DataTable dt = new DataTable( tableName ); 
519InBlock.gif            dt.Columns.Add( fieldName, sourceTable.Columns[ fieldName ].DataType ); 
520InBlock.gif 
521InBlock.gif            object lastValue = null
522InBlock.gif            foreach ( DataRow dr in sourceTable.Select( "", fieldName ) ) 
523ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
524InBlock.gif                if ( lastValue == null || !( ColumnEqual( lastValue, dr[ fieldName ] ) ) ) 
525ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
526InBlock.gif                    lastValue = dr[ fieldName ]; 
527ExpandedSubBlockStart.gifContractedSubBlock.gif                    dt.Rows.Add( new object[]dot.gif{lastValue} ); 
528ExpandedSubBlockEnd.gif                }
 
529ExpandedSubBlockEnd.gif            }
 
530InBlock.gif            if ( ds != null && !ds.Tables.Contains( tableName ) ) 
531ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
532InBlock.gif                ds.Tables.Add( dt ); 
533ExpandedSubBlockEnd.gif            }
 
534InBlock.gif            return dt; 
535ExpandedSubBlockEnd.gif        }
 
536InBlock.gif 
537ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//**//**//// <summary> 
538InBlock.gif        /// 按照fieldName从sourceTable中选择出不重复的行, 
539InBlock.gif        /// 相当于select distinct fieldName1,fieldName2,,fieldNamen from sourceTable 
540InBlock.gif        /// </summary> 
541InBlock.gif        /// <param name="tableName">表名</param> 
542InBlock.gif        /// <param name="sourceTable">源DataTable</param> 
543InBlock.gif        /// <param name="fieldNames">列名数组</param> 
544ExpandedSubBlockEnd.gif        /// <returns>一个新的不含重复行的DataTable,列只包括fieldNames中指明的列</returns> 

545InBlock.gif        public DataTable SelectDistinct(string tableName, DataTable sourceTable, string[] fieldNames) 
546ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
547InBlock.gif            DataTable dt = new DataTable( tableName ); 
548InBlock.gif            object[] values = new object[fieldNames.Length]; 
549InBlock.gif            string fields = ""
550InBlock.gif            for ( int i = 0; i < fieldNames.Length; i++ ) 
551ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
552InBlock.gif                dt.Columns.Add( fieldNames[ i ], sourceTable.Columns[ fieldNames[ i ] ].DataType ); 
553InBlock.gif                fields += fieldNames[ i ] + ","
554ExpandedSubBlockEnd.gif            }
 
555InBlock.gif            fields = fields.Remove( fields.Length - 11 ); 
556InBlock.gif            DataRow lastRow = null
557InBlock.gif            foreach ( DataRow dr in sourceTable.Select( "", fields ) ) 
558ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
559InBlock.gif                if ( lastRow == null || !( RowEqual( lastRow, dr, dt.Columns ) ) ) 
560ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
561InBlock.gif                    lastRow = dr; 
562InBlock.gif                    for ( int i = 0; i < fieldNames.Length; i++ ) 
563ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
564InBlock.gif                        values[ i ] = dr[ fieldNames[ i ] ]; 
565ExpandedSubBlockEnd.gif                    }
 
566InBlock.gif                    dt.Rows.Add( values ); 
567ExpandedSubBlockEnd.gif                }
 
568ExpandedSubBlockEnd.gif            }
 
569InBlock.gif            if ( ds != null && !ds.Tables.Contains( tableName ) ) 
570ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
571InBlock.gif                ds.Tables.Add( dt ); 
572ExpandedSubBlockEnd.gif            }
 
573InBlock.gif            return dt; 
574ExpandedSubBlockEnd.gif        }
 
575InBlock.gif 
576ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//**//**//// <summary> 
577InBlock.gif        /// 按照fieldName从sourceTable中选择出不重复的行, 
578InBlock.gif        /// 并且包含sourceTable中所有的列。 
579InBlock.gif        /// </summary> 
580InBlock.gif        /// <param name="tableName">表名</param> 
581InBlock.gif        /// <param name="sourceTable">源表</param> 
582InBlock.gif        /// <param name="fieldName">字段</param> 
583ExpandedSubBlockEnd.gif        /// <returns>一个新的不含重复行的DataTable</returns> 

584InBlock.gif        public DataTable Distinct(string tableName, DataTable sourceTable, string fieldName) 
585ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
586InBlock.gif            DataTable dt = sourceTable.Clone(); 
587InBlock.gif            dt.TableName = tableName; 
588InBlock.gif 
589InBlock.gif            object lastValue = null
590InBlock.gif            foreach ( DataRow dr in sourceTable.Select( "", fieldName ) ) 
591ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
592InBlock.gif                if ( lastValue == null || !( ColumnEqual( lastValue, dr[ fieldName ] ) ) ) 
593ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
594InBlock.gif                    lastValue = dr[ fieldName ]; 
595InBlock.gif                    dt.Rows.Add( dr.ItemArray ); 
596ExpandedSubBlockEnd.gif                }
 
597ExpandedSubBlockEnd.gif            }
 
598InBlock.gif            if ( ds != null && !ds.Tables.Contains( tableName ) ) 
599ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
600InBlock.gif                ds.Tables.Add( dt ); 
601ExpandedSubBlockEnd.gif            }
 
602InBlock.gif            return dt; 
603ExpandedSubBlockEnd.gif        }
 
604InBlock.gif 
605ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//**//**//// <summary> 
606InBlock.gif        /// 按照fieldNames从sourceTable中选择出不重复的行, 
607InBlock.gif        /// 并且包含sourceTable中所有的列。 
608InBlock.gif        /// </summary> 
609InBlock.gif        /// <param name="tableName">表名</param> 
610InBlock.gif        /// <param name="sourceTable">源表</param> 
611InBlock.gif        /// <param name="fieldNames">字段</param> 
612ExpandedSubBlockEnd.gif        /// <returns>一个新的不含重复行的DataTable</returns> 

613InBlock.gif        public DataTable Distinct(string tableName, DataTable sourceTable, string[] fieldNames) 
614ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
615InBlock.gif            DataTable dt = sourceTable.Clone(); 
616InBlock.gif            dt.TableName = tableName; 
617InBlock.gif            string fields = ""
618InBlock.gif            for ( int i = 0; i < fieldNames.Length; i++ ) 
619ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
620InBlock.gif                fields += fieldNames[ i ] + ","
621ExpandedSubBlockEnd.gif            }
 
622InBlock.gif            fields = fields.Remove( fields.Length - 11 ); 
623InBlock.gif            DataRow lastRow = null
624InBlock.gif            foreach ( DataRow dr in sourceTable.Select( "", fields ) ) 
625ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
626InBlock.gif                if ( lastRow == null || !( RowEqual( lastRow, dr, dt.Columns ) ) ) 
627ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
628InBlock.gif                    lastRow = dr; 
629InBlock.gif                    dt.Rows.Add( dr.ItemArray ); 
630ExpandedSubBlockEnd.gif                }
 
631ExpandedSubBlockEnd.gif            }
 
632InBlock.gif            if ( ds != null && !ds.Tables.Contains( tableName ) ) 
633ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
634InBlock.gif                ds.Tables.Add( dt ); 
635ExpandedSubBlockEnd.gif            }
 
636InBlock.gif            return dt; 
637ExpandedSubBlockEnd.gif        }
 
638InBlock.gif 
639ExpandedSubBlockEnd.gif        #endregion
 
640InBlock.gif 
641ContractedSubBlock.gifExpandedSubBlockStart.gif        Select Table Into#region Select Table Into 
642InBlock.gif 
643ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//**//**//// <summary> 
644InBlock.gif        /// 按sort排序,按rowFilter过滤sourceTable, 
645InBlock.gif        /// 复制fieldList中指明的字段的数据到新DataTable,并返回之 
646InBlock.gif        /// </summary> 
647InBlock.gif        /// <param name="tableName">表名</param> 
648InBlock.gif        /// <param name="sourceTable">源表</param> 
649InBlock.gif        /// <param name="fieldList">字段列表</param> 
650InBlock.gif        /// <param name="rowFilter">过滤条件</param> 
651InBlock.gif        /// <param name="sort">排序</param> 
652ExpandedSubBlockEnd.gif        /// <returns>新DataTable</returns> 

653InBlock.gif        public DataTable SelectInto(string tableName, DataTable sourceTable, 
654InBlock.gif            string fieldList, string rowFilter, string sort) 
655ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
656InBlock.gif            DataTable dt = CreateTable( tableName, sourceTable, fieldList ); 
657InBlock.gif            InsertInto( dt, sourceTable, fieldList, rowFilter, sort ); 
658InBlock.gif            return dt; 
659ExpandedSubBlockEnd.gif        }
 
660InBlock.gif 
661ExpandedSubBlockEnd.gif        #endregion
 
662InBlock.gif 
663ContractedSubBlock.gifExpandedSubBlockStart.gif        Group By Table#region Group By Table 
664InBlock.gif 
665InBlock.gif        public DataTable SelectGroupByInto(string tableName, DataTable sourceTable, string fieldList, 
666InBlock.gif            string rowFilter, string groupBy) 
667ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
668InBlock.gif            DataTable dt = CreateGroupByTable( tableName, sourceTable, fieldList ); 
669InBlock.gif            InsertGroupByInto( dt, sourceTable, fieldList, rowFilter, groupBy ); 
670InBlock.gif            return dt; 
671ExpandedSubBlockEnd.gif        }
 
672InBlock.gif 
673ExpandedSubBlockEnd.gif        #endregion
 
674InBlock.gif 
675ContractedSubBlock.gifExpandedSubBlockStart.gif        Join Tables#region Join Tables 
676InBlock.gif 
677InBlock.gif        public DataTable SelectJoinInto(string tableName, DataTable sourceTable, string fieldList, string rowFilter, string sort) 
678ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
679InBlock.gif            DataTable dt = CreateJoinTable( tableName, sourceTable, fieldList ); 
680InBlock.gif            InsertJoinInto( dt, sourceTable, fieldList, rowFilter, sort ); 
681InBlock.gif            return dt; 
682ExpandedSubBlockEnd.gif        }
 
683InBlock.gif 
684ExpandedSubBlockEnd.gif        #endregion
 
685InBlock.gif 
686ContractedSubBlock.gifExpandedSubBlockStart.gif        Create Table#region Create Table 
687InBlock.gif 
688InBlock.gif        public DataTable CreateTable(string tableName, string fieldList) 
689ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
690InBlock.gif            DataTable dt = new DataTable( tableName ); 
691InBlock.gif            DataColumn dc; 
692InBlock.gif            string[] Fields = fieldList.Split( ',' ); 
693InBlock.gif            string[] FieldsParts; 
694InBlock.gif            string Expression; 
695InBlock.gif            foreach ( string Field in Fields ) 
696ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
697InBlock.gif                FieldsParts = Field.Trim().Split( " ".ToCharArray(), 3 ); // allow for spaces in the expression 
698InBlock.gif                // add fieldname and datatype 
699InBlock.gif                if ( FieldsParts.Length == 2 ) 
700ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
701InBlock.gif                    dc = dt.Columns.Add( FieldsParts[ 0 ].Trim(), Type.GetType( "System." + FieldsParts[ 1 ].Trim(), truetrue ) ); 
702InBlock.gif                    dc.AllowDBNull = true
703ExpandedSubBlockEnd.gif                }
 
704InBlock.gif                else if ( FieldsParts.Length == 3 ) // add fieldname, datatype, and expression 
705ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
706InBlock.gif                    Expression = FieldsParts[ 2 ].Trim(); 
707InBlock.gif                    if ( Expression.ToUpper() == "REQUIRED" ) 
708ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
709InBlock.gif                        dc = dt.Columns.Add( FieldsParts[ 0 ].Trim(), Type.GetType( "System." + FieldsParts[ 1 ].Trim(), truetrue ) ); 
710InBlock.gif                        dc.AllowDBNull = false
711ExpandedSubBlockEnd.gif                    }
 
712InBlock.gif                    else 
713ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif
714InBlock.gif                        dc = dt.Columns.Add( FieldsParts[ 0 ].Trim(), Type.GetType( "System." + FieldsParts[ 1 ].Trim(), truetrue ), Expression ); 
715ExpandedSubBlockEnd.gif                    }
 
716ExpandedSubBlockEnd.gif                }
 
717InBlock.gif                else 
718ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
719InBlock.gif                    return null
720ExpandedSubBlockEnd.gif                }
 
721ExpandedSubBlockEnd.gif            }
 
722InBlock.gif            if ( ds != null ) 
723ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
724InBlock.gif                ds.Tables.Add( dt ); 
725ExpandedSubBlockEnd.gif            }
 
726InBlock.gif            return dt; 
727ExpandedSubBlockEnd.gif        }
 
728InBlock.gif 
729InBlock.gif        public DataTable CreateTable(string tableName, string fieldList, string keyFieldList) 
730ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif
731InBlock.gif            DataTable dt = CreateTable( tableName, fieldList ); 
732InBlock.gif            string[] KeyFields = keyFieldList.Split( ',' ); 
733InBlock.gif            if ( KeyFields.Length > 0 ) 
734ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif
735InBlock.gif                DataColumn[] KeyFieldColumns = new DataColumn[KeyFields.Length]; 
736InBlock.gif                int i; 
737InBlock.gif                for ( i = 1; i == KeyFields.Length - 1++i ) 
738ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif
739InBlock.gif                    KeyFieldColumns[ i ] = dt.Columns[ KeyFields[ i ].Trim() ]; 
740ExpandedSubBlockEnd.gif                }
 
741InBlock.gif                dt.PrimaryKey = KeyFieldColumns; 
742ExpandedSubBlockEnd.gif            }
 
743InBlock.gif            return dt; 
744ExpandedSubBlockEnd.gif        }
 
745InBlock.gif 
746ExpandedSubBlockEnd.gif        #endregion
 
747ExpandedSubBlockEnd.gif    }

748ExpandedBlockEnd.gif}

749 None.gif    

转载于:https://www.cnblogs.com/zixin/archive/2006/06/20/430323.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值