日期:2014-05-17 浏览次数:20764 次
using System;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Text;
namespace Demo50K
{
class Program
{
static void Main(string[] args)
{
string s = new string('a', 1000000);
using (SqlConnection connection = new SqlConnection("Data Source=localhost;Initial Catalog=demo; User ID=sa;Password=sa;"))
{
connection.Open();
SqlCommand cmd = new SqlCommand("insert into tb (txt) values (@txt)", connection);
cmd.Parameters.Add("@txt", s);
cmd.ExecuteNonQuery();
//create xk document
StreamWriter writer = new StreamWriter("out.txt", false, Encoding.Default);