易截截图软件、单文件、免安装、纯绿色、仅160KB

Excel 导入sqlserver c#

using System.Data.SqlClient;
using System.Data.OleDb;
 private void button1_Click(object sender, EventArgs e)
        {
OleDbConnection conn = null;
            try
            {
                string path = "./Users.xls";
                string strConn;
                strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +
                    "Data Source=" + path + ";" +
                "Extended Properties='Excel 8.0;HDR=Yes;IMEX=1;'";
                conn = new OleDbConnection(strConn);
                conn.Open();
                string Sql = "select * from [Users$]";
                System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand();
                OleDbDataAdapter ddp = new OleDbDataAdapter(Sql, conn);
                DataTable dt = new DataTable();
                ddp.Fill(dt);
                ddp.D


相关文档:

C#绘制圆角窗体

public   void   SetWindowRegion()    
  {    
 
System.Drawing.Drawing2D.GraphicsPath   FormPath;    
  FormPath   =
  new   System.Drawing.Drawing2D.GraphicsPath();    
  Rectangle  
rect=ne ......

C#发牌

之前不太喜欢C#,无意中发现linq,用来实现排序是如此简单,所以又用C#写了遍发牌程序
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
    class Program
    {
      &nb ......

C# 获取当前是星期几的两种方法

C#的功能很强大,却没有直接提供面向汉字文化的开发倾向
比如我现在要说的获取当前的星期我提供两种方法:
①,DateTime.Now.DayOfWeek ,查询MSDN可以知道该属性返回的结果是:
//
        // 摘要:
        //     获取 ......

sqlserver 基础知识大整理

                              SQL-Structured Query Language
--(开启SQL服务:net start mssqlserver)
--(在命令行中输入'sqlwb'命令可打开SQL管理器 )
--(如果 ......

sqlserver分页

现在一般常用的有以下2种方法:
1. select top @pagesize * from table1 where id not in  (select top @pagesize*(@page-1) id  from table1 order by id) order by id
2. select *  from (select top @pagesize * from (select top @pagesize*@page * from table1 order by id) a order by id desc) b or ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号