随笔分类 -  C#_technology

About c# technology
20230509001 - DataTable 导出成Excel
摘要:private void Btn_Export_Click(object sender, EventArgs e) { if (dt == null) { MessageBox.Show(" 数据为空,不能导出, " + "\r\n 导出已经终止。", "提示:导出失败", MessageBoxBu 阅读全文

posted @ 2023-05-09 16:51 追逐苦痛 阅读(34) 评论(0) 推荐(0)

20230425001 - DataGridView绑定了数据之后, 再添加CheckBox列的解决方案
摘要:if (dgv_M.Columns[0].Name != "select") { DataGridViewCheckBoxColumn checkBoxColumn = new DataGridViewCheckBoxColumn(); checkBoxColumn.Name = "select"; 阅读全文

posted @ 2023-04-25 09:15 追逐苦痛 阅读(91) 评论(0) 推荐(0)

20230424001 - 打开文件对话框OpenFileDialog类
摘要://定义一个文件打开控件 OpenFileDialog ofd = new OpenFileDialog(); //设置打开对话框的初始目录,默认目录为exe运行文件所在的路径 ofd.InitialDirectory = Application.StartupPath; //设置打开对话框的标题 阅读全文

posted @ 2023-04-24 16:32 追逐苦痛 阅读(96) 评论(0) 推荐(0)

ASP.net用Graphics实现的统计图(折线图、柱状图、饼图)
摘要:一.折线图 代码: private void CreateImage() { int height = 480, width = 700; Bitmap image = new Bitmap(width,height); Graphics g = Graphics.FromImage(image); 阅读全文

posted @ 2020-05-20 17:15 追逐苦痛

20190917001 - 去除DataTable中重复的数据
摘要:// 去除DataTable中重复的数据需要用到DataView,代码如下: DataView dv = new DataView(dt1);//_dt是一个DataTable类型的变量 //dt1 = dv.ToTable(true, "业务员"); //第一个参数为true,去除重复数据,fal 阅读全文

posted @ 2019-09-17 16:03 追逐苦痛 阅读(187) 评论(0) 推荐(0)

20180709001 - 委托传值
摘要:Main : Frm_MRP_P Sub : Frm_SO_S_Selected Frm_SO_S_Selected public partial class Frm_SO_S_Selected : Form { //声明委托 public delegate void TransfDelegate( 阅读全文

posted @ 2018-07-09 13:51 追逐苦痛 阅读(234) 评论(0) 推荐(0)

20180519001 - DataTable Group by功能参考
摘要:DataSet6 = DataSet1.Copy(); DataRow[] dr = DataSet6.Tables[0].Select(" 完工状态 = '完工异常' "); DataTable dt1 = DataSet6.Tables[0].Clone(); for (int i = 0; i 阅读全文

posted @ 2018-05-19 11:58 追逐苦痛 阅读(533) 评论(0) 推荐(0)

20161020001 DataGridView 选中的 DataGridViewCheckBoxCell 不添加重复项
摘要:private void btn_add_Click(object sender, EventArgs e) { string str_P_ID = ""; string str_P_Type = ""; string str_P_Name = ""; int count = Convert.ToI 阅读全文

posted @ 2016-10-20 11:46 追逐苦痛 阅读(303) 评论(0) 推荐(0)

20161014006 DataGridView Combobox 数据绑定与传值
摘要://Combobox private void T_Form_CY_CBD_D_CurrentCellChanged(object sender, EventArgs e) { DataGridViewCell CurrnetCell = T_Form_CY_CBD_D.CurrentCell; T 阅读全文

posted @ 2016-10-14 16:00 追逐苦痛 阅读(657) 评论(0) 推荐(0)

20161014001 DataGridView 单元格内容 自动计算
摘要:private void T_Form_CY_CBD_D_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (T_Form_CY_CBD_D.Rows.Count > 0 && e.RowIndex >= 0) { / 阅读全文

posted @ 2016-10-14 15:57 追逐苦痛 阅读(760) 评论(0) 推荐(0)

20161013001 DataGridView 数据转 DataTable
摘要:DataTable dt2 = GetDgvToTable(Form_CY_ProjectRequirements_D); MessageBox.Show( dt2.Rows.Count.ToString()); //// protected DataTable GetDgvToTable(Data 阅读全文

posted @ 2016-10-13 15:23 追逐苦痛 阅读(180) 评论(0) 推荐(0)

20161011001 treeView 递归
摘要:protected void FillTree() { H_data H_data = new H_data(); H_data.sql_text1 = " select [FID],[N_Name],[N_Parent_ID] FROM [PLM].[dbo].[T_Sys_File_Tree] 阅读全文

posted @ 2016-10-11 15:29 追逐苦痛 阅读(141) 评论(0) 推荐(0)

20160929001 Guid生成
摘要:全局唯一标识符(GUID,Globally Unique Identifier)是一种由算法生成的二进制长度为128位的数字标识符。 using System; namespace GUID测试 { class Program { static void Main(string[] args) { 阅读全文

posted @ 2016-09-29 17:11 追逐苦痛 阅读(160) 评论(0) 推荐(0)

20160330001 调用及触发Office Outlook 约会
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;u 阅读全文

posted @ 2016-03-30 17:15 追逐苦痛 阅读(449) 评论(0) 推荐(0)

20151210001 DataGridView 选中与被选中
摘要:// DataSet_IP list private void DataSet_IP_list() { DataSet_IP = new System.Data.DataSet(); DataTable tb = new DataTable("Ds_IP"); DataColumnCollecti... 阅读全文

posted @ 2015-12-10 17:26 追逐苦痛 阅读(612) 评论(0) 推荐(0)

20151125001 询问对话框 中的文字换行
摘要:20151125001 询问对话框 中的文字换行 try { if (MessageBox.Show(" 您要确认删除全部发卡记录吗? \r\n 全部删除后将不可恢复, 只能重新发卡!", "删除确认!", MessageBoxButtons.YesNo) == DialogResult.Yes) ... 阅读全文

posted @ 2015-11-25 09:52 追逐苦痛 阅读(341) 评论(0) 推荐(0)

20151124002 treeView 数型菜单的操作
摘要:20151124002 treeView 数型菜单的操作 protected void FillTree() { SqlConnection1 = new System.Data.SqlClient.SqlConnection(); SqlConnection1.ConnectionString =... 阅读全文

posted @ 2015-11-24 21:49 追逐苦痛 阅读(179) 评论(0) 推荐(0)

20151124001 关闭C#主窗体弹出是否关闭对话框
摘要:关闭C#主窗体弹出是否关闭对话框 private void Frm_Main_FormClosing(object sender, FormClosingEventArgs e) { DialogResult TS = MessageBox.Show("确定要关闭并退出程序?", "退出提示", ... 阅读全文

posted @ 2015-11-24 21:45 追逐苦痛 阅读(730) 评论(0) 推荐(0)

Reflector8.5 .net反编译工具 破解教程
摘要:一、断网二、打开软件、打开注册机三、 四、 五、 六、 七、 八、 阅读全文

posted @ 2015-08-05 10:57 追逐苦痛 阅读(652) 评论(0) 推荐(0)

ds.Merge 与 ds.Tables[0].Merge 的用法
摘要:DataSet ds = new DataSet(); SqlConnection conn = new SqlConnection(ConnectionStr); SqlCommand cmd = new SqlCommand(); cmd.CommandTimeout = 180;SqlPar... 阅读全文

posted @ 2015-07-27 14:44 追逐苦痛 阅读(541) 评论(0) 推荐(0)