Problem with parameters and blob's
Hi,
I want to insert an image into an mysql database.
it only inserts NULL values, and this code works with SQLServer.
Can anyone help me with this.
Thanks
Cornel
Dot.Net 1.1
MySQL 4.0.20a Windows binary
Simple table with a text and Blob field
Here is the Code...
MySqlConnection connection = new MySqlConnection("Database=test;user id=root;password=;Data Source=localhost");
connection.Open();
MySqlCommand command = new MySqlCommand("insert into image (Name,Image) values (@Name,@Image)",connection);
MySqlParameter NameParm = new MySqlParameter("@Name",MySqlDbType.VarChar,100);
NameParm.Value = txtName.Text;
command.Parameters.Add(NameParm);
MySqlParameter ImageParm = new MySqlParameter("@Image",MySqlDbType.Blob,photo.Length);
ImageParm.Value = photo;
command.Parameters.Add(ImageParm);
command.ExecuteNonQuery();
connection.Close();
Subject
Written By
Posted
Problem with parameters and blob's
January 14, 2005 08:05AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.