随笔分类 -  C#

摘要:inta=12345678;//格式为sring输出//Label1.Text=string.Format("asdfadsf{0}adsfasdf",a);//Label2.Text="asdfadsf"+a.ToString()+"adsfasdf";//Label1.Text=string.Format("asdfadsf{0:C}adsfasdf",a);//asdfadsf¥1,234.00adsfasdf//Label2.Text="asdfadsf"+a.ToString(&quo 阅读全文
posted @ 2013-07-17 14:48 Vincent.Dr 阅读(249) 评论(0) 推荐(0) 编辑
摘要:System.BadImageFormatException : 未能加载文件或程序集“xxxxx.xxxxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。试图加载格式不正确的程序。原因是项目CPU默认X86我的系统是X64,将目标平台改为Any CPU就可以了. 阅读全文
posted @ 2013-07-09 16:05 Vincent.Dr 阅读(1410) 评论(2) 推荐(0) 编辑
摘要:Step 1. Add the following code in what you want to debug.System.Diagnostics.Debugger.Launch();Step 2. Install and start the service.That's it.However, other way as below url:http://stackoverflow.com/questions/4678819/how-to-debug-windows-services-in-visual-studio 阅读全文
posted @ 2013-06-21 18:43 Vincent.Dr 阅读(265) 评论(0) 推荐(0) 编辑
摘要:DateTimeFormatInfo pattern = new DateTimeFormatInfo() { ShortDatePattern = "your date pattern" }; DateTime date = Convert.ToDateTime("your date string",pattern);This method can convert any valid date string to a DateTime. 阅读全文
posted @ 2013-05-20 11:21 Vincent.Dr 阅读(154) 评论(0) 推荐(0) 编辑
摘要:Global.asax 文件,有时候叫做 ASP.NET 应用程序文件,提供了一种在一个中心位置响应应用程序级或模块级事件的方法。你可以使用这个文件实现应用程序安全性以及其它一些任务。下面让我们详细看一下如何在应用程序开发工作中使用这个文件。概述 Global.asax 位于应用程序根目录下。虽然 Visual Studio .NET 会自动插入这个文件到所有的 ASP.NET 项目中,但是它实际上是一个可选文件。删除它不会出问题——当然是在你没有使用它的情况下。.asax 文件扩展名指出它是一个应用程序文件,而不是一个使用 aspx 的 ASP.NET 文件。 Global.asax 文件被 阅读全文
posted @ 2013-05-03 15:07 Vincent.Dr 阅读(273) 评论(0) 推荐(0) 编辑
摘要:If we using 'OLE DB Source' component to obtain the data source and export to the Excel File.The convert exception will be catch when column is varchar.So we can change the varchar to nvarchar or using a 'Data Convertor' component to convert.------However. I got a other problem.In th 阅读全文
posted @ 2013-04-20 02:53 Vincent.Dr 阅读(622) 评论(0) 推荐(0) 编辑
摘要:More Info please click :http://timradney.com/2011/05/17/using-an-excel-destination-in-ssis-with-x64/ 阅读全文
posted @ 2013-04-20 01:56 Vincent.Dr 阅读(149) 评论(0) 推荐(0) 编辑
摘要:Exception Details:NHibernate.Cfg.HibernateConfigException: An exception occurred during configuration of persistence layer. ---> System.IO.FileNotFoundException: Could not find file 'C:\Windows\system32\Config\hibernate.cfg.xml'.Reason:By default window services set the default directory 阅读全文
posted @ 2013-03-13 17:55 Vincent.Dr 阅读(800) 评论(0) 推荐(0) 编辑
摘要:More info please click the url as below.http://www.sapphiresteel.com/Products/Ruby-In-Steel/FAQ/Editor/A-dialog-box-warns-abouthttp://blog.csdn.net/qwertyuj/article/details/7056717 阅读全文
posted @ 2013-02-25 12:16 Vincent.Dr 阅读(291) 评论(0) 推荐(0) 编辑
摘要:Nhibernate配置文件中:<property name="show_sql">false</property>此配置用于调试时在控制台输出sql script,检查错误,但是会大大影响导入效率。 阅读全文
posted @ 2013-01-25 16:44 Vincent.Dr 阅读(160) 评论(0) 推荐(0) 编辑
摘要:Error info:Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))I try to found the solution. and I found out it is NOT possible to us 阅读全文
posted @ 2013-01-23 18:46 Vincent.Dr 阅读(1609) 评论(0) 推荐(0) 编辑
摘要:1 public class PortfolioReport 2 { 3 string TemplateFileName = "Temp.xlsx"; 4 string NewFileName = @"C:\NewFile.xlsx"; 5 6 private WorkbookPart WbPart = null; 7 8 //Manager function 9 public PortfolioReport() 10 { 11 Cop... 阅读全文
posted @ 2013-01-23 18:22 Vincent.Dr 阅读(820) 评论(0) 推荐(0) 编辑
摘要:Using OpenXml.The type 'System.IO.Packaging.Package' is defined in an assembly that is not referenced. You must add a reference to assembly 'WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.---solutions---Add WindowsBase.dll in 'Add Reference' - 阅读全文
posted @ 2013-01-23 11:50 Vincent.Dr 阅读(770) 评论(0) 推荐(0) 编辑
摘要:Solutions:Select the 'Microsoft.Office.Interop.Excel' reference -> right click -> properties -> set 'Embel Interop Types' to False -> set 'Copy Local' to True.In my project. I just copy the 'Microsoft.Office.Interop.Excel.dll' to my local libraries.The &qu 阅读全文
posted @ 2013-01-21 14:03 Vincent.Dr 阅读(2427) 评论(0) 推荐(0) 编辑
摘要:The type 'Microsoft.Office.Interop.Excel.ApplicationClass' has no constructors definedInterop type 'Microsoft.Office.Interop.Excel.ApplicationClass' cannot be embedded. Use the applicable interface instead.---Solution---Disable embedding of Interop types for this assembly (References 阅读全文
posted @ 2013-01-15 15:36 Vincent.Dr 阅读(1560) 评论(0) 推荐(0) 编辑