jinyuttt

导航

2011年12月21日

c# 求一定的大阶乘

摘要: 错了哈。以后完善 阅读全文

posted @ 2011-12-21 23:09 代码苦行僧 阅读(321) 评论(0) 推荐(0) 编辑

2011年10月15日

读取excel

摘要: public DataTable GetData(string strpath, string strSql,string ExcelEdition) { DataTable dtgc = null; OleDbConnection con = null; try { string strCon; switch(ExcelEdition) { case "2003": strCon= "provider=microsoft.jet.oledb.4.0;data source=" + strpath + ";extended properties 阅读全文

posted @ 2011-10-15 21:41 代码苦行僧 阅读(261) 评论(0) 推荐(0) 编辑

2011年8月3日

dbf导入sqlserver

摘要: --如果接受导入数据的SQL表已经存在 Insert Into 已经存在的SQL表名 Select * From openrowset('MSDASQL','Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=c:','select * from aa.DBF') --也可以对应列名进行导入,如: Insert Into 已经存在的SQL表名 (列名1,列名2...) Select (对应列名1,对应列名2...) From openrowset('MSDASQL&# 阅读全文

posted @ 2011-08-03 10:11 代码苦行僧 阅读(4810) 评论(0) 推荐(0) 编辑

Ad Hoc Distributed Queries组件

摘要: 启用Ad Hoc Distributed Queries:exec sp_configure 'show advanced options',1reconfigureexec sp_configure 'Ad Hoc Distributed Queries',1reconfigure 使用完成后,关闭Ad Hoc Distributed Queries:exec sp_configure 'Ad Hoc Distributed Queries',0reconfigureexec sp_configure 'show advanced op 阅读全文

posted @ 2011-08-03 10:06 代码苦行僧 阅读(223) 评论(0) 推荐(0) 编辑

2011年7月12日

判断本机安装的excel版本

摘要: public List<string> ExcelVsion() { List<string> list=new List<string>(); List<string> lisemp = new List<string>(); List<string> listvison = new List<string>(); RegistryKey rk = Registry.LocalMachine; RegistryKey akey = rk.OpenSubKey(@"SOFTWARE\\Microsof 阅读全文

posted @ 2011-07-12 14:18 代码苦行僧 阅读(322) 评论(0) 推荐(0) 编辑

2011年7月11日

查看excel文件和导出

摘要: public System.Data.DataTable dsmdata()//查看 { public static string strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =d:\\csd.xls;Extended Properties=Excel 8.0"; OleDbConnection conn = new OleDbConnection(strCon); string sql = "select * from [Sheet1$]"; conn.Open(); OleD 阅读全文

posted @ 2011-07-11 20:08 代码苦行僧 阅读(681) 评论(0) 推荐(0) 编辑

查看csv文件导出csv文件c#

摘要: public DataTable ReadCSV(string pathcsv,string FileName) { OleDbConnection OleCon = new OleDbConnection(); OleDbCommand OleCmd = new OleDbCommand(); OleDbDataAdapter OleDa = new OleDbDataAdapter(); DataSet dsCsvData = new DataSet(); OleCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Da 阅读全文

posted @ 2011-07-11 20:02 代码苦行僧 阅读(2184) 评论(0) 推荐(0) 编辑

2011年6月22日

plsql不能连接本地oracle数据库安装了odp.net

摘要: 看了资料照做没有用,很蛋疼。理清了原理,把oracle安装目录下的tnsnames文件拷贝到客户端对应的目录下面就可以了。 阅读全文

posted @ 2011-06-22 01:09 代码苦行僧 阅读(280) 评论(0) 推荐(0) 编辑

2011年5月24日

映射获取调用方法的方法名称c#

摘要: using System.Diagnostics;using System.Reflection;StackTrace ss = new StackTrace(true);string t =ss.GetFrame(2).GetMethod().DeclaringType.ToString()+"."+ss.GetFrame(2).GetMethod().Name; return t;获取2级调用的方法名称,GetFrame(index),index的值讲影响获取的层级方法。StackTrace ss = new StackTrace(true); string t = s 阅读全文

posted @ 2011-05-24 16:46 代码苦行僧 阅读(553) 评论(0) 推荐(1) 编辑

利用C#的反射机制动态调用DLL类库

摘要: 1、使用Assembly类定义和加载程序集,加载在程序集清单中列出模块,以及从此程序集中查找类型并创建该类型的实例。2、使用MethodInfo了解方法的名称、返回类型、参数、访问修饰符(如pulic 或private)和实现详细信息(如abstract或virtual)等。使用Type的GetMethods或GetMethod方法来调用特定的方法。一、创建用于反射调用的DLLusing System;using System.Collections.Generic;using System.Text;namespace RefDll{ /// <summary> /// 创建需要 阅读全文

posted @ 2011-05-24 16:31 代码苦行僧 阅读(1660) 评论(0) 推荐(0) 编辑