那你不要拼SQL,而使用C# 中的SqlCommand,他就是定义变量,使用变量的.

解决方案 »

  1.   

    使用参数的形式
    SqlCommand cmd = new SqlCommand("", _connection, _transaction);
    string sql="Insert Into tb_Article(Content) Values(@Content)";
    cmd.Parameters.Add("@Content", dbtype.ntext).value = yourcontect;
    cmd.ExecuteNonQuery();
      

  2.   

    不要直接使用insert语句来做,而使用数据适配器来操作DataAdapter.Update,.net中类型对应为byte[]
    参考:
    http://www.codeproject.com/aspnet/FileUpload.asp