12 2012 档案
摘要:有时候的树结构更复杂,层数多,可能不止在一个表中查询。如一个项目中的树结构:层数不固定,最后的树叶层时从不同的表中查询得到。先利用了上一篇中生成树的方法:表中的结构和上篇中的机构基本相同。private void CreateTree(TreeNode PNode, int traceCode) { string strSql = "select treecode,treename from TraceTree where ptreecode = " + traceCode; DataTable dt = SqlClass.GetTab...
阅读全文
摘要:需要添加到TreeView 中的数据在数据库中的存储表: ID 为主键,PID 表明数据之间的关系。/// <summary>/// 生产树的代码;/// </summary>/// <param name="node"> 根节点</param>/// <param name="id">主键</param> private void CreateTwo(TreeNode node, int id) { string strSql = "select * from Table
阅读全文
摘要:comboBox1.SelectedIndex = 0;//设置第一项为默认选择项。comboBox1.SelectedItem = combItem;
阅读全文
摘要:在 SQL Server 2008 中,自定义 函数 :Create function CurrentMonthFirstDay()returns Datetimeasbegin DECLARE @FistDayOfCurrentMonth DATETIME SET @FistDayOfCurrentMonth = DATEADD(mm,DATEDIFF(mm,0,getdate()),0) return @FistDayOfCurrentMonthend 发现在2000中 不能运行, 首先 getedate() 不识别 ----- 改为 dbo.getdate(). 可用生产了,但是不...
阅读全文
浙公网安备 33010602011771号