我是一个新手,不知道怎么样处理批量数据,在网上找了很久,基本上都是vb的或是c++的,要不数据库就是oracle的,哪位大侠知道怎么处理C#程序的吗?指点一下 谢谢

解决方案 »

  1.   

    insert into a select * from b
      

  2.   

    例如
    protected void Button1_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection();
            conn.ConnectionString = "Data Source=172.16.50.111;Initial Catalog=sa;Persist Security Info=True;User ID=sa;Password=webadmin;Pooling=False";
            try
            {
                conn.Open();
                string sql = "Insert into Table2(ID,Name,Sex,Age) values('" + TextBox1.Text + "', '" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "')";
                SqlCommand cmd = new SqlCommand(sql, conn);
                cmd.ExecuteNonQuery();
            }
            catch (Exception expt)
            {
                throw new ApplicationException(expt.Message);
            }
            finally
            {
                conn.Close();       
            }
        }
      

  3.   

    如果是程序里的数据批量插入数据库,则在cs代码里面for
    如果是数据库里面的数据批量,则在存储过程里面循环
      

  4.   

    insert into 表名 select 列名,列名 union select 列名,列名 union select 列名,列名
      

  5.   

    将数据定义为XML格式,将起传入数据库,在数据库中用XPATH解析这个XML存入!