2013年3月20日

列转行?

摘要: select top 10 orderid,stuff((select ','+product_no from orderdetail where o.orderid=orderid group by orderid,product_no for xml path('')),1,1,'')from orderdetail o group by orderid 阅读全文

posted @ 2013-03-20 14:28 习惯简单 阅读(95) 评论(0) 推荐(0)

pivot 使用

摘要: pivot 使用 阅读全文

posted @ 2013-03-20 14:25 习惯简单 阅读(193) 评论(0) 推荐(0)

cross apply 应用

摘要: cross apply 阅读全文

posted @ 2013-03-20 14:20 习惯简单 阅读(170) 评论(0) 推荐(0)

2012年11月10日

委托 事件 多线程 简单例子

摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Threading;namespace Teseweituo{ public partial class Form1 : Form { public Form1() { ... 阅读全文

posted @ 2012-11-10 14:42 习惯简单 阅读(133) 评论(0) 推荐(0)

2012年10月25日

rn.ShowDialog() == DialogResult.OK

摘要: //主窗体ChildForm f=new ChildForm();if(f.ShowDialog() == DialogResult.OK){......................................}//ChildForm某事件{this.DialogResult = DialogResult.OK;} 阅读全文

posted @ 2012-10-25 15:07 习惯简单 阅读(370) 评论(0) 推荐(0)

dataGridView 控制行是否全选

摘要: 首先需要有一列为DataGridViewDisableCheckBox,然后再标题加一个checkbox,以此控制全选与否。//绑定数据源后遍历dataGridView 确定是否显示checkbox foreach (DataGridViewRow dgvr in dataGridView1.Rows) { if (dgvr.Cells["Column16"].Value.ToString() != "已导入待执行") { (dgvr.Cells["Column21"] as... 阅读全文

posted @ 2012-10-25 10:18 习惯简单 阅读(247) 评论(0) 推荐(0)

2012年10月22日

存储过程XML格式字符串转@table

摘要: //C#StringBuilder sb = new StringBuilder(); sb.Append("<data>"); for (int i = 0; i < drs.Count; i++) { sb.Append("<row eid=\"" + drs[i].Cells["Column1"].Value.ToString() + "\" ejine=\"" + drs[i].Cells["Column11"].Value.ToSt 阅读全文

posted @ 2012-10-22 11:41 习惯简单 阅读(298) 评论(1) 推荐(0)

2012年10月18日

c#选择文件并读取EXECL

摘要: //选取try { string strexcelPath; openFileDialog1.Filter = "Excel2003 *xls|*xls|Excel2007 *xlsx|*xlsx"; openFileDialog1.FileName = ""; //1、读取数据 openFileDialog1.Multiselect = false; if (openFileDialog1.S... 阅读全文

posted @ 2012-10-18 15:56 习惯简单 阅读(1109) 评论(0) 推荐(0)

JSON转XML

摘要: public static XmlDocument Json2Xml(string sJson) { //XmlDictionaryReader reader = JsonReaderWriterFactory.CreateJsonReader(Encoding.UTF8.GetBytes(sJson), XmlDictionaryReaderQuotas.Max); //XmlDocument doc = new XmlDocument(); //doc.Load(reader); Java... 阅读全文

posted @ 2012-10-18 15:01 习惯简单 阅读(487) 评论(0) 推荐(0)

HTTP请求

摘要: public static string DoPost(string url, IDictionary<string, string> parameters) { HttpWebRequest req = GetWebRequest(url, "POST"); req.ContentType = "application/x-www-form-urlencoded;charset=utf-8"; byte[] postData = Encoding.UTF8.GetBytes(BuildQuery(paramete... 阅读全文

posted @ 2012-10-18 15:00 习惯简单 阅读(185) 评论(0) 推荐(0)

导航