posted @ 2011-04-11 17:00 beeone 阅读(467) 评论(0) 推荐(0)
摘要:
Excel操作类 /// <summary> /// Excel操作类 /// </summary> public class Excel { #region 私有属性 private _Application _oExcel = null; //Excel应用程序 private _Workbook _oBook = null; //Excel工作薄 private _Worksheet _oSheet = null; //Excel工作表 private bool _visible=false; //是否显示Excel程序 #endregion #region 公共 阅读全文
摘要:
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using DevComponents.DotNetBar;using DevComponents.DotNetBar.Controls;namespace CsharpTest{ public partial class Form1 : Form { public Form1() 阅读全文
posted @ 2011-04-11 16:02 beeone 阅读(925) 评论(0) 推荐(0)
摘要:
break表示跳出循环,continue表示结束本次循环 示例程序如下: #include"stdio.h" voidmain() {intn,m; for(n=1;n<=10;n++)/*这个循环输出1234,在n是5的时候循环退出*/ {if(n==5) break; printf("%d",n); } printf("\n"); for(m=1;m<=10;m++)/*这个循环输出1234678910,*/ {if(m==5)/*在m是5的时候没有执行当次循环的其他语句,所以未输出5*/ continue; prin 阅读全文
posted @ 2011-04-11 15:38 beeone 阅读(236) 评论(0) 推荐(0)
摘要:
TimeSpan ts = dtbig - dtsmall; if (ts.TotalDays <= 5) 阅读全文
posted @ 2011-04-10 17:32 beeone 阅读(243) 评论(0) 推荐(0)
摘要:
使用以下方法可以准确的记录代码运行的耗时。 System.Diagnostics.Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); // 开始监视代码运行时间 // you code .... stopwatch.Stop(); // 停止监视 TimeSpan timespan = stopwatch.Elapsed; // 获取当前实例测量得出的总时间 double hours = timespan.TotalHours; // 总小时 double minutes = timespan.Tota 阅读全文
posted @ 2011-04-09 21:39 beeone 阅读(1285) 评论(0) 推荐(1)
摘要:
private void MakeDataTableAndDisplay(){ // Create new DataTable. DataTable myDataTable = new DataTable("MyDataTable"); // Declare DataColumn and DataRow variables. DataColumn myDataColumn; DataRow myDataRow; // Create new DataColumn, set DataType, ColumnName and add to DataTable. myDataCol 阅读全文
posted @ 2011-04-09 21:22 beeone 阅读(3543) 评论(0) 推荐(0)
摘要:
要过滤与排序DataTable对象中的DataRow,用DataTable的Select()方法,Select()方法调用:DataRow[] Select()DataRow[] Select(string filterExpression)DataRow[] Select(string filterExpression,string sortExpression)DataRow[] Select(string filterExpression,string SortExpression,DataViewRowState myDataViewRowState)其中:filterExpressi 阅读全文
posted @ 2011-04-09 21:21 beeone 阅读(3513) 评论(0) 推荐(0)
摘要:
DataTable排序的一般方法一、重生法dstaset.Tables.Add(dt)dataset.Tables(0).DefaultView.Sort = "id desc"--------------------------------------------------------------------------------二、直接法dv = New DataView(dt)dv.Sort = "id desc"------------------------------------------------------------------ 阅读全文
posted @ 2011-04-09 21:20 beeone 阅读(960) 评论(0) 推荐(0)
摘要:
using System;using System.Data;namespace DataTable_Create{/// <summary>/// 使用DataTable实现内存表/// </summary>class T{ /// <summary> /// 使用DataTable实现内存表 /// </summary> private void CreateDataTable() { // 声明一个DataTable DataTable myDataTable = new DataTable("ParentTable") 阅读全文
posted @ 2011-04-09 21:20 beeone 阅读(1563) 评论(0) 推荐(0)
浙公网安备 33010602011771号