12 2011 档案
摘要:protected void EgvPhotoAdvertisement_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { System.Data.DataRowView dt = (System.Data.DataRowView)e.Row.DataItem; string imgPath ...
阅读全文
摘要:FOR XML子句有四种最基本的模式1、AUTO模式:返回数据表为起表名的元素,每一列的值返回为属性;2、RAW模式:返回数据行为元素,每一列的值作为元素的属性;3、PATH模式:通过简单的XPath语法来允许用户自定义嵌套的XML结构、元素、属性值4、EXPLICIT模式:通过SELECT语法定义输出XML的结构第1步:构造测试数据表及填充数据:--1.建表语句CREATE TABLE [dbo].[Users]( [UserID] [int] IDENTITY(1,1) NOT NULL, [FirstName] [nvarchar](50) NULL, [LastName] [nvarc
阅读全文
摘要:DECLARE @x xmlSET @x = '<?xml version="1.0" encoding="utf-8"?><getDealDetail><errorCode>0</errorCode><errorMessage></errorMessage><buyerName></buyerName><buyerUin>284073437</buyerUin><buyerRemark></buyerRema
阅读全文
摘要:按下面步骤一步一步操作即可完成效果,效果图:第一步:SQL构造测试数据1.创建一个产生随机数据的SQL函数:CREATE FUNCTION [GenerateRandomName] ( @LENGTH INT )
RETURNS NVARCHAR(255)
AS BEGIN --DECLARE VARIABLES DECLARE @RandomNumber NVARCHAR(255) DECLARE @I SMALLINT DECLARE @RandNumber FLOAT DECLARE @Position T...
阅读全文
摘要:nt32. Parse (string)Int32.Parse (string str) method converts the string representation of a number to its 32-bit signed integer equivalent. It takes a string and tries to extract an integer from it and returns the integer. When s is a null reference, it will throwArgumentNullException. If str is not
阅读全文
摘要:namespace Framework
{ using System; using System.Collections; using System.IO; using KTDictSeg; /// <summary> /// 关键字辅助类 /// </summary> public class KeyWordHelper { public static CSimpleDictSeg m_SimpleDictSeg; /// <summary> /// 提取关键字 ...
阅读全文
摘要:namespace Framework
{ using System; using System.Globalization; using System.Text; /// <summary> /// 随机数辅助类 /// </summary> public sealed class RandomHelper { private static readonly char[] RandChar = { '0', '1', '2', '3', '4', '5', '6&#
阅读全文
摘要:using System;
using System.Collections.Generic; using System.Text;
using System.Globalization;
using System.Text.RegularExpressions; namespace Framework
{ /// <summary> /// 字符串辅助类 /// </summary> public static class StringHelper { /// <summary> /// 截取字符串的后部分 ...
阅读全文
摘要:using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Collections; namespace Framework
{ /// <summary> /// 将xml转换为json /// </summary> public class XmlToJson { /// <summary> /// 将xml转换为json ///...
阅读全文
摘要:using System;
using System.Collections.Generic; using System.Text;
using System.Net;
using System.IO;
using Newtonsoft.Json;
using System.Web; namespace Framework
{ /// <summary> /// 语言翻译类 /// </summary> public class Translater { /// <summary> /// 翻译方法 中文:"zh-cn...
阅读全文
摘要:using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using System.Net; namespace Framework
{ /// <summary> /// 网页采集辅助类 /// </summary> public static class CollectionHelper { /// <summa...
阅读全文
摘要:比如需导出如下形式的报表:里面数据字段分类很多,又含公式统计等情况。解决方案:利用NPOI组件,制作导出模板,对单元格精确控制,通过读取单元格里的模板字段,进行数据匹配替换;模板形式如下:核心方法: /// <summary> /// 根据Excel模板单元格内容,找出单元格,并设置单元格的值 /// </summary> /// <param name="sheet">ExcelSheet</param> /// <param name="rowIndex">行索引</param>
阅读全文