随笔分类 - c#.net
学习笔记
摘要:GetMethod(string name)在反射重载方法时,如果调用此重载方法,会产生 发现不明确的匹配 的错误。解决方案如下:GetMethod("MethodName", new Type [] { typeof(参数类型)});其中type数组中的项的个数是由要调用的方法的参数个数来决定的。...
阅读全文
摘要:1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName-获取模块的完整路径。2.System.Environment.CurrentDirectory-获取和设置当前目录(该进程从中启动的目录)的完全限定目录。3.S...
阅读全文
摘要:一、动态生成列的格式化 此种GridView中的列是动态生成的,格式化可以通过RowDataBound事件进行。如下边代码,对第十列的值进行格式化。protected void gvUserList_RowDataBound(object sender, GridViewRowEventArgs ...
阅读全文
摘要:private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if ( e == null || e.Value == null ...
阅读全文
摘要:一般情况下,我们定义的一个SqlParameter参数数组,如: SqlParameter[] parms = { new SqlParameter("@DateTime1", dtBegin), new SqlParameter("@DateTime2", dtEnd) };如果只给一个SqlCommand使用,这种情况的参数使用,不会出现异常,但如果该参数数组同时给两个Sqlcommand使用,就会出现如下异常: System.ArgumentException: 另一个SqlParameterCollection中已包含SqlParameter。
阅读全文

浙公网安备 33010602011771号