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