博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年6月12日

摘要: select p.product_id,max(i.ImagesPath) ImagesPath from teapp as p,Base_Images as i where p.Product_id=i.Product_Id group by p.product_id 阅读全文

posted @ 2011-06-12 19:54 moss_tan_jun 阅读(248) 评论(0) 推荐(0) 编辑

摘要: 测试项目图片:BS网站包括一个WebService1.asmx web服务 和webForm1.aspx页面namespace WebApplication_Web{ /// <summary> /// WebService1 的摘要说明 /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxIte 阅读全文

posted @ 2011-06-12 19:46 moss_tan_jun 阅读(631) 评论(0) 推荐(0) 编辑

摘要: 在开发winform程序的时候,经常会遇到如下情况:1、把参数从一个窗口传给另外一个窗口2、更新窗体信息内容时,同时更新另一个的窗口中对于第一个情况,我们经常采用的方法如下:(1)、构造函参数传递public class MyClassA:Form{ private string arg="test"; //一个button按钮事件 private void btnOK_Click(object sender,EventArgs e) { MyClassB frm=new MyClassB(arg); frm.show(); }}public class MyClassB: 阅读全文

posted @ 2011-06-12 19:42 moss_tan_jun 阅读(964) 评论(0) 推荐(0) 编辑

摘要: 有时,我们需要在DataGridView中,针对某行数据进行简单的变换操作,且变换后显示的内容要与变换关不一致,不能再变回来,如下图:网上搜索到一个贴子,里面提供了两种办法,我选用了其中一种。http://social.msdn.microsoft.com/Forums/en/winformsapplications/thread/f82ec651-6b22-44b0-8ead-15796387424f就是将这个DataGridViewButtonCell换成 DataGridViewTextBoxCell,非常简单上图的实现代码:view sourceprint?private void g 阅读全文

posted @ 2011-06-12 19:36 moss_tan_jun 阅读(2336) 评论(2) 推荐(0) 编辑

摘要: 在数据库中,我们经常用一些简单的数值(如0、1、2等)代表一定含义,如:是/否,男/女,正确/错误,已婚/未婚/离异等。但在DataGridView控件中如何显示呢?一种办法是使用 select Case 语句。二种方法就是使用DataGridView 列定制。这里主要讲的是第二种方法。在设置DataGridView列属性时,将ColumnType设置为DataGridViewComboBoxColumn,DisplayStyle设置为Nothing,然后是代码:在窗体加载过程中录入下列代码:view sourceprint?((DataGridViewComboBoxColumn)gvSal 阅读全文

posted @ 2011-06-12 19:34 moss_tan_jun 阅读(1422) 评论(0) 推荐(0) 编辑

摘要: 效果View Code usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsFormsApplication1{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}publicoverridestring 阅读全文

posted @ 2011-06-12 19:32 moss_tan_jun 阅读(1561) 评论(0) 推荐(0) 编辑

摘要: 父窗口调用子窗口,关闭子窗口将内容返回给父窗口//父窗口调子窗口函数 private void ShowLinkDBDialog(object sender, EventArgs e) { //连接子对话框。 fchild obj = new fchild(this);//this父窗口 obj.WindowState = FormWindowState.Normal; obj.ShowDialog(); this.TextBox1.Text = obj.RetValue; }子窗口相关内容private Form _parentForm=null; private static string 阅读全文

posted @ 2011-06-12 19:17 moss_tan_jun 阅读(1242) 评论(0) 推荐(0) 编辑

摘要: 这一段时间做的软件中需要用到页面间传值,以前一直是在NEW出FORM对象的时候就把值给赋进去,当然FORM对象的控件属性必须为public,今天却不行了,因为这次需要将NEW出来的新窗体的值赋予主窗体的的控件,想了很多方法都不行,偶然在网上看到重写构造函数的方法,仅在此记录,顺便归纳. 页面间传值: 方法一: (条件)form1 show 出form2,在form2中有textbox1控件,要在弹出form2窗体时给textbox1赋值. 将form2的textbox1的属性设为public. from2 frm=new form2(); frm.textbox1.text="要赋予 阅读全文

posted @ 2011-06-12 18:01 moss_tan_jun 阅读(568) 评论(0) 推荐(0) 编辑

摘要: WinForm中的窗体传值有多种方法,自己结合相关资料总结了一下,大概有5种方式(或者更多):1、通过 ShowDialog()进行传值;2、通过改造构造函数进行传值(加参数);3、通过公共静态类进行传值;4、通过绑定事件进行传值;5、使用Attribute(本人属初学,尚需深入研究,希望高手给与指正)代码如下:主窗体代码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using 阅读全文

posted @ 2011-06-12 17:52 moss_tan_jun 阅读(9158) 评论(1) 推荐(1) 编辑