摘要:
private void DataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex >= 0) { if (e.Button == System.Windows.Forms.MouseButtons.Right) { dataGridView1.CurrentCe... 阅读全文
摘要:
首先是在项目中添加resource 文件命名为“MyResource”其属性中的Customer Toor会自动赋值为“ResXFileCodeGenerator”使其作为资源生成中心,然后将其拖入Properties文件夹中之后就是添加真正的语言资源文件了,命名方式为“MyResource.文化特性/語言名稱”文化特性/語言... 阅读全文
摘要:
System.Globalization.CultureInfo.InstalledUICulture.Name这是获得英文的区域码,也就是zh-cn的这种,需要找区域码字典对照。System.Globalization.CultureInfo.InstalledUICulture.NativeName 这是翻译成中文的那种。 int lcid = System.Globalization.Cul... 阅读全文
摘要:
做一个关于“Creatinga satellite assembly for culture specific resource file and using it in the executing assembly”的练习添加了resources 文件之后 并在其中添加Name(Key) 、value 注:在以****.resx命名的resources文件中label1.... 阅读全文
摘要:
假设你有form1和form2两个窗口类,在form1中创建子窗口form2有两种情况:创建模态对话框form2和创建非模态对话框form2: 一、如果创建模态对话框,如下有两种情况,其中有一种是错误的,是一定要避免的: 错误的情况,如下: form1中 private void button1_Click(object sender, EventArgs e) { Form2 fm = new... 阅读全文
摘要:
今天在想完善一下以前做的小的购物系统,在查看订单方面本来使用两个页面分别显示“订单”和“订单内容”这样管理员查看十分不方便。于是我构思了一下,在显示“订单”的GridView中添加一个HyperLink控件,通过点击HyperLink将订单号传给“订单内容”的控件中去,然后在下一个GridView中显示... 阅读全文
摘要:
这个错误第一次遇到的时候感到很莫名,就是说比如我的语句是cmd.Parameters.Add("@BookReserve", SqlDbType.Int, 4); cmd.Parameters["@BookReserve"].Value = entity.BookReserve我单步调试发现,通过Add方法,BookReserve已经在SqlParameterCollection 存在了,可是为什... 阅读全文
摘要:
可以在打开连接语句外套一个判断语句if (conn.State ==ConnectionState.Closed) { conn.Open();}或者查看open语句外部是否已经包裹了open的语句如:public ***** (){ SqlConnection conn = new SqlConnection(*********); conn.open() using(**********... 阅读全文
摘要:
private void DataTable2Excel(System.Data.DataTable dtData, String FileName) { System.Web.UI.WebControls.GridView dgExport = null; // System.Web.HttpContext curContext = System.Web.HttpContext.Curren... 阅读全文
摘要:
来源:http://www.cnblog.com 作者:Jeffery Zhao 一直说C#是强类型语言,通俗地讲,便是指C#中的“变量”在开发时的类型便是明确的:String便是String,Int32就是Int32,毫无争议。强类型的好处有很多,张嘴便可随意举上几例: 能够享受代码提示功能能够获得重构工具的支持能够在编译期发现更多错误…… 不... 阅读全文