sp_textcopy是把文件从数据库中image类型的字段中读到文件里面的,我在查询分析器中是对的,可以创建文件,但是在vs.net中条用存储过程的时候就没有反应,为什么呢?
private void button4_Click(object sender, EventArgs e) { myConnection.Open(); SqlCommand sql = new SqlCommand("exec sp_textcopy 'B501AD6C83D74E4','','','mami','product','picture','" + textBox3.Text + "','where pid=32','I'", myConnection); try { int rowAffected = sql.ExecuteNonQuery(); MessageBox.Show("添加!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (SqlException ex) { MessageBox.Show("插入错误:" + ex.Message, "出现错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } myConnection.Close(); }