insert into
或存储过程

解决方案 »

  1.   

    string myExecuteQuery = "INSRET INTO TABLE1(……)VALUES (……)";
    SqlCommand myCommand = new SqlCommand(myExecuteQuery, myConnection);
    myCommand.Connection.Open();
    myCommand.ExecuteNonQuery();
    myConnection.Close();
      

  2.   

    string strSql="INSERT INTO TABLE1(FILENAME,IMAGE)VALUES(@FILENAME,@IMAGE);
    sqlCommand cmd=new sqlCommand(strSql,myConn);
    cmd.Parameters.Add("@Filename", SqlDbType.NVarChar, 50)).Value = 文件名变量; cmd.Parameters.Add(new SqlParameter("@Picture", SqlDbType.Image)).Value = 字节流;
    cmd.ExecuteNonQuery();
      

  3.   

    我还是习惯用oledbdateadapter和dataset,简单
      

  4.   

    string myExecuteQuery = "INSRET INTO TABLE1(……)VALUES (……)";
    SqlCommand myCommand = new SqlCommand(myExecuteQuery, myConnection);
    myCommand.Connection.Open();
    myCommand.ExecuteNonQuery();
    myConnection.Close();
      

  5.   

    用dataset的update也行
    也可以像楼上的用command
      

  6.   


    用Adapter的Update()方法。
    邮CommondBuilder自动产生SQL语句。它包含开放式并发机制,更能保证数据的完整性。但性能差一点,且不易读懂。