Hello every body !
How can I insert blob data to DB2 by .Net?
DB2Connection d2Conn = new DB2Connection();
d2Conn.ConnectionString = "Server=192.168.1.107:50000;Database=dbtest;UID=db 2admin;PWD=db2admin";
d2Conn.Open();
DB2Command d2Command = new DB2Command();
d2Command.Connection = d2Conn;
d2Command.CommandType = CommandType.StoredProcedure;
d2Command.CommandText = "PROFILE_ADD";
List<DB2Parameter> list = new List<DB2Parameter>();
DB2Parameter p1 = new DB2Parameter();
p1.ParameterName = "v_ID";
p1.Value = "0000000001";
p1.DB2Type = DB2Type.Graphic;
p1.Size = 10;
list.Add(p1);
DB2Parameter obj2 = new DB2Parameter();
obj2 .DB2Type = DB2Type.Blob;
obj2 .ParameterName = "v_FileContent";
FileStream fs = new FileStream("C:\Text.txt", FileMode.OpenOrCreate, FileAccess.Read);
byte[] MyData = new byte[fs.Length];
fs.Read(MyData, 0, System.Convert.ToInt32(fs.Length));
fs.Close();
obj2.Value = MyData;
d2Command.Parameters.AddRange(list.ToArray());
d2Command.ExecuteNonQuery();
When run that source code, the error "ERROR [57011] [IBM][DB2/NT] SQL0930N There is not enough storage available to process the statement. SQLSTATE=57011" has been throw.
How can I fix this error? Please help me!!!!!!
