摘要:
public class CollectionHelper { private CollectionHelper() { } public static DataTable ConvertTo(IList list) { DataTable table = CreateTable(); Type entityType = typeof(T); PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(e... 阅读全文
摘要:
1、执行命令示例:EXEC sys.sp_attach_db @dbname = 'AdventrueWorks2012_Data', @filename1 = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\ExampleData\AdventureWorks2012_Data.mdf'2、 补全日志文件 操作方法: 1、创建AdventureWorks2012_Data 名的数据库,将会创建一个名称为AdventureWorks2012_Data.ldf文件 2、将 阅读全文
摘要:
前端代码如下: 1、使用escape对中文变量的值进行统一编码; function SearchAllPages(page, pagesize) { var activityState = $("#activityState").val(); var activityName = $("#activityName").val(); var startTime = $("#txtStartTime").attr("value"); var endTime = $("#... 阅读全文
摘要:
namespace ConsoleApplication2{ class Program { static void Main(string[] args) { Me eventSource = new Me("Learning Hard"); Friend1 obj1 = new Friend1(); Friend2 obj2 = new Friend2(); eventSource.BirthDayEvent += new BirthDayEventHandle(... 阅读全文
摘要:
using System;using System.Linq;class Program{ static void Main() { //~ 以下测试是使结构体s2=s1,然后修改s2的数据,观察对s1的影响 var s1=new S1(); s1.Title="I'm s1"; s1.firstPoint=new Point(0,0); s1.otherPoint=new Point[]{new Point(1,1),new Point(2,2)}; //~ 直接赋值,使s2=s1... 阅读全文
摘要:
1、创建项目,其项目结构如下:项目结构说明: DataSetWebService 为Web Service Sites ,用于提供服务; Test 为windows form 测试程序, 用于测试效果。服务提供程序代码DataSetService.asmx<%@ WebService Language="C#" CodeBehind="DataSetService.asmx.cs" Class="DataSetWebService.DataSetService" %>DataSetService.asmx.csusing 阅读全文
摘要:
1、 打开 VS2010 Prompt 工具,创建证书。 输入以下命令:makecert.exe -sr LocalMachine -ss MY -a sha1 -n CN=localhost -sky exchange -pecertmgr.exe -add -r LocalMachine -s My -c -n localhost -r CurrentUser -s TrustedPeople2、设置证书访问权限按照下面的步骤可解决 IIS7 Keyset does not exist 的问题, 根源为权限问题1:运行 输入 mmc2:Console -> file->add/ 阅读全文
摘要:
CREATE DATABASE Sales ON PRIMARY( NAME = N'Sales', FILENAME = N'd:\DATA\Sales.mdf', SIZE = 3MB, MAXSIZE = 100MB, FILEGROWTH =10% ), FILEGROUP FG1 ( NAME = N'File1', FILENAME = N'd:\DATA\File1.ndf', SIZE = 1MB, MAXSIZE = 100MB, FILEGROWTH = 10% ), FILEGROU... 阅读全文
摘要:
#region Import data from excel to SQL. /// <summary> /// Import data from excel to SQL Server, but the difference struct of table . /// </summary> public static void ImportDataFromExcelToSQLDemo(string filename) { // Load Excel data into... 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using Excel;using System.IO;using System.Data;namespace ReadExcelData{ class Program { static void Main(string[] args) { string filePath = @"E:\WorkDocuments\TestD\Book1.xlsx"; ... 阅读全文