callraheel
Well-known member
' getphoto will return the array of bytes of images
Dim photo() As Byte = GetPhoto()
myCommand.CommandText = "INSERT INTO photos(PhotoID,PhotoSize,Photo) VALUES(@PhotoID,@PhotoSize,@Photo);"
myCommand.Parameters.Add("@PhotoID", MySqlDbType.VarChar).Value = txtSID.Text
myCommand.Parameters.Add("@PhotoSize", MySqlDbType.Double).Value = _GetPhotoLength()
myCommand.Parameters.Add("@Photo", MySqlDbType.LongBlob).Value = photo
myCommand.ExecuteNonQuery()
And the error is as follows
MySql.Data.MySqlClient.MySqlException: #23000Column 'PhotoID' cannot be null
The procedure of adding photo like this is found in .NET Framework 1.1 documentation and in an example.
Anyhelp will be appreciated
Regards
Dim photo() As Byte = GetPhoto()
myCommand.CommandText = "INSERT INTO photos(PhotoID,PhotoSize,Photo) VALUES(@PhotoID,@PhotoSize,@Photo);"
myCommand.Parameters.Add("@PhotoID", MySqlDbType.VarChar).Value = txtSID.Text
myCommand.Parameters.Add("@PhotoSize", MySqlDbType.Double).Value = _GetPhotoLength()
myCommand.Parameters.Add("@Photo", MySqlDbType.LongBlob).Value = photo
myCommand.ExecuteNonQuery()
And the error is as follows
MySql.Data.MySqlClient.MySqlException: #23000Column 'PhotoID' cannot be null
The procedure of adding photo like this is found in .NET Framework 1.1 documentation and in an example.
Anyhelp will be appreciated
Regards