发博文
我去过的地方
国内 (0篇)
国外 (0篇)
个人资料
巴顿
巴顿
  • 博客等级:
  • 博客积分:805
  • 博客访问:27,466
  • 关注人气:3
访客
加载中…
评论
加载中…
留言
加载中…
博文
标签:

dabletable

字段顺序

it

分类: c#

DataTable myDt =dt;
//删除列
myDt.Columns.Remove('minArea');
myDt.Columns.Remove('maxArea');

//调整列顺序 ,列排序从0开始
myDt.Columns['num'].SetOrdinal(1);

//修改列标题名称
dt.Columns['num'].ColumnName = '搜索量';
dt.Columns['rate'].ColumnName = '百分比';


阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

判断

字段

杂谈

分类: sql

if not exists(select * from syscolumns where id=object_id('TManagerReg') and name='SectionName')
print('you')
else print('meiyou')

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

带参数

存储过程

杂谈

分类: sql

create procedure [dbo].[POS_GetSalesInfo]
@parentID varchar(36)
as
begin
select
TUserBaseInfo.UserID,
TUserBaseInfo.UserType,
TUserBaseInfo.LoginID,
TUserBaseInfo.LPassword,
TUserBaseInfo.LastLoginDate,

TUserReg.CompanyName,
TUserReg.ContactPersonName,
TUserReg.Tel,
TUserReg.Mobile,
TUserReg.Fax,
TUserReg.Email,
TUserReg.CompanyAddress,
TUserReg.CompanyNameEN,

TUserMapping.ID,
TUserMapping.ParentID,
TUserMapping.ParentType

from TUserBaseInfo
 inner join TUserMapping on TUserBaseInfo.UserID=TUserMapping.UserID
 inner join TUserReg on TUserMapping.UserID=TUserReg.UserID where TUserMapping.ParentID=@parentID

end

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

webservice

大数据

传输

杂谈

分类: c#

控制台程序,没有注释,在我本机10G数据量没有问题

using System;
using System.Collections.Generic;

using System.Text;
using System.IO;

namespace controtest
{
    class Program
    {
      
        static void Main(string[] args)
        {
            string rst = string.Empty;
            PartnerWebservice.PartnerServices pa = new PartnerWebservice.PartnerServices();
            string path = System.Configuration.ConfigurationSettings.AppSettings['path'].ToString();
            string filename = System.Configuration.ConfigurationSettings.AppSettings

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

大文件

传输

it

分类: c#

好吧,我想我的写写了。我用的方法很简单,首先先把大文件转换成byte数组,然后调用webservice将byte数组转换成文件。但是如果文件大小超过25M的时候会超时,所以我将这个数组分批传输,每一批都是一个20M的byte数组,然后把这些数组追加,最后形成一个完整的文件。注意在形成文件的时候要判断要生成的文件是否存在,否则如果文件已经存在的话,该文件不会被覆盖,而是被追加。

 

using System;
using System.Collections.Generic;

using System.Text;
using System.IO;

namespace controtest
{
    class Program
    {
        static byte[] buffer;
        static void Main(string[] args)
        {
            string rst =string.Empty ;
            PartnerWebservice.PartnerServices pa = new

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

sql

导出

脚本

杂谈

分类: sql

首先启用导入导出功能,执行以下脚本

sp_configure 'show advanced options', 1;
go
reconfigure;
go
 

sp_configure 'xp_cmdshell', 1;
go
reconfigure;
go

然后执行这个,以下是POSWebsales2数据库的TSAPOrder   导出到E:\CSV目录下的TSAPOrder.CSV   文件

sa是用户名password是密码

exec   master..xp_cmdshell   'bcp   POSWebsales2.dbo.TSAPOrder   out   E:\CSV\TSAPOrder.CSV   /U sa   /P password   /c   /t ',''

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

二进制

文件

杂谈

分类: c#

 public bool TransFile(byte[] fileBt,string fileName)
    {
        bool ok = true ;

        string filePath = System.Configuration.ConfigurationManager.AppSettings['CSVPath'].ToString();   //文件路径

        FileStream fstream = File.Create(filePath+fileName, fileBt.Length);
        try
        {
            fstream.Write(fileBt, 0, fileBt.Length);   //二进制转换成文件
        }
        catch (Exception ex)
        {
            //抛出异常信息
       

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2011-12-11 11:07)
标签:

判断

sql

是否存在

杂谈

分类: sql

if OBJECT_ID('gTBulletin') is not null--貌似这个更准确一点

 

if exists
(select count(*) from sysobjects where id = object_id('数据库名.Owner.表名'))
print '存在'
else
print '不存在'

参考文献:http://database.51cto.com/art/201009/226835.htm

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2011-11-14 23:02)
标签:

读取

excel表格

杂谈

分类: c#

Excel表格的第二种读取方法,类似于数组操作。

我们知道Excel是由许多单元格组成,我们可以把这些单元格看作是数组中的元素。而Excel就是数组的集合。

例如表示某个单元格,语句如下:

wSheet.Cells[x, y]

//x,y从1开始,例如wSheet.Cells[2, 3]表示第一行第三列的单元格

举个例子:

using Microsoft.Office.Interop.Excel;
using Aspose.Excel;
using System.Reflection;

 public bool ReadExcel2(string filePath)
        {
           
            try
            {
                                Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Off

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2011-11-03 21:19)
标签:

sharepoint

对象模型

杂谈

分类: moss

sharepoint对象模型及相关属性

首先介绍关于SharePoint对象模型的开发简单的入门
SharePoint对象模型概述
一些基本对象
Farm, Service, Web Application, Site, Web
List, View, Field, Item
几个主要功能
文件结构
权限系统
查询
集合(Collection)
很多对象都有集合
SPWeb–SPWebCollection
SPList - SPListCollection

操作
Get:xxCollection[idx], xxCollection.GetxxxByxxx
Add: xxCollection.Add
Del: xxCollection.Delete, xx.Delete, xx.Recycle
Update: xx.Update
集合(Collection)
向下访问
site.AllWebs
web.Lists
list.Views

向上访问
web.Site
list.ParentWeb
view.ParentList

四种Url
absolute url
[moss]
server-relative url
/sites/myweb/doc/folder/file.doc
xx.ServerRelativeUrl
site-relative url
doc/folder/file.doc
xx.Url
relative url
file.doc (base = folder)

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
  

新浪BLOG意见反馈留言板 不良信息反馈 电话:4006900000 提示音后按1键(按当地市话标准计费) 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

新浪公司 版权所有