摘要:using System;using System.Collections.Generic;using System.Text;using System.Net.Sockets;using System.Net;using System.Windows.Forms;namespace SocketClient{ /// <summary> /// C#网络Socket的数据发送与接收处理(利用异步)的模板(模式) /// </summary> class test_Socket { Socket m_Socket; /// <summary> /// C#网
阅读全文
摘要:#region ASP.NET动态菜单生成通用方法 private void InitTree0(Menu TV,DataSet ds) //根结点加载函数 { TV.Items.Clear(); //TV为TreeView控件 DataRow[] rows = ds.Tables[0].Select("parent_id=0"); for (int i = 0; i < rows.Length; i++) { MenuItem T_root = new MenuItem(); DataRow dr ...
阅读全文
摘要:--工程上一例误差范围的计算方法(利用穷举法俗称笨方法又称愚公移山法还可称愚公大战智叟法) declare @Const_A DECIMAL(8,6),@Const_B DECIMAL(8,6),@Const_C DECIMAL(8,6), @p DECIMAL(16,6),@q DECIMAL(16,6),@c DECIMAL(16,6),@Step_p float,@Step_q floatdeclare @t table(p DECIMAL(16,6),q DECIMAL(16,6),c DECIMAL(16,6))select @Const_A=0.001,@Const_B=0.00.
阅读全文
摘要:SQL Server 2000实现一则按类似VB VAL函数功能排序的案例 最近,在项目维护时,碰到对以下的数据进行排序处理:排序前: 班级 照片名称 机械1班 1张三.jpg 机械1班 7李四.jpg 机械1班 3王五.jpg 财会2班 3如花.jpg 财会2班 6像花.jpg 财会2班 1真花.jpg 体育1班 3铁男.jpg 体育1班 1猛男.jpg 财会2班 10若花.jpg 体育1班 3...
阅读全文
摘要:--SQL Server TEXT类型字段字符串替换示例处理脚本/*--text字段的替换处理 --*/ --创建数据测试环境 --create table #tb(aa text)declare @s_str varchar(8000),@d_str varchar(8000), --定义替换的字符串 @p varbinary(16),@postion int,@rplen int,@i_...
阅读全文
摘要:--获取SQL Server服务器的连接信息用脚本(在原邹建写的基础上作一点改进)declare@dbname sysname,--要查询的数据库名(为空为所有),默认查询所有数据库的连接信息@includeip bit--是否显示IP地址(0否,1是),因为查询IP地址比较费时,所以增加此控制select @dbname=null,@includeip=1declare @dbid intset...
阅读全文
摘要:--字符串前部去除自定义函数(T-SQL)Create FUNCTION f_delete_head(@s varchar(8000),@flag varchar(10))returns varchar(8000) --字符串前部去除自定义函数as begin declare @i int select @i=1 while (@i<=len(@s)) begin if (substring...
阅读全文
摘要:复习:C#3.0面向对象测试开发包----------------Form1.cs文件using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms...
阅读全文
摘要:--M1非接触式射频存储卡卡唯一号(十六进制值表示),去除其前部为0的自定义函数Create FUNCTION dbo.f_header_zero_delete(@s varchar(8)) RETURNS varchar(8)ASBEGINdeclare @i int,@ss varchar(8)select @i=(case when substring(@s,1,1)<>'0' ...
阅读全文
摘要:--同一张表内、利用变化的上一行数据动态地修改下一行数据(示例Demo) /**//* CREATE TABLE Account ( [Month] [datetime] NOT NULL Prmary Key, [PlanFare] [money] NULL , [PutoutFare] [money] NULL , [PlanPreFare]...
阅读全文
摘要:--同一表内,各部份行自动重新编号T-SQL处理代码 select identity(int,1,1) as id,* into # from DS order by Department select Department,min(id) as n,max(id) as m into #DMN from # group by Department update DS set DS...
阅读全文
摘要:高兴,学习中量变到质变,ASP.NET 2.0 树型数据的显示源代码(原创,用递归) using System; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Web; using System.Web.Security; using System.We...
阅读全文