日期:2014-05-18 浏览次数:20844 次
OdbcConnection cn = new OdbcConnection("DSN=Testgdb;UID=SYSDBA;PWD=masterkey;"); try { //写入BLOB字段 byte[] myBlob = System.Text.Encoding.UTF8.GetBytes(TextBoxDetails.Text); string myString = string.Format("update customer set SUMMARY= (@summary) where CUSTID='{0}' and SNAME='{1}'",TextBoxNo.Text , TextBoxCorp.Text); cn.Open(); OdbcCommand cmd = new OdbcCommand(myString, cn); cmd.Parameters.Add("@summary", SqlDbType.Image).Value = myData; Response.Write(myString); cmd.ExecuteNonQuery(); } catch (OdbcException ex) { Response.Write(ex.Message); } finally { cn.Close(); }