As the title says:
I got a problem using parameters in the mysql.data.client.mysqlcommand
This is my code:
error: #23000Column 'data' cannot be nullCode:Dim querystring As String querystring = "INSERT INTO tblpicture(data) VALUES(@Picture)" Dim QueryT As New MySqlCommand(querystring, connection) QueryT.Parameters.Add("@Picture", MySqlDbType.String) QueryT.Parameters(0).Value = "hello" Console.WriteLine(QueryT.Parameters.Item(0).Value) Console.WriteLine(QueryT.CommandText) QueryT.ExecuteNonQuery() ' causes the error
Data column i set was set to NOT NULL
I got truely no idea what is goeing wrong here.
I am planning on saving banairy data in the database and saw this as the only solution. It doesnt matter with what kind of datatype i try it, it wont work. So this was for people who wanted to ask why i dont just add the string in de string.
These are the 2 lines from the output.:
So the parrams realy work as you see. I can read them out if i want to.Code:hello INSERT INTO tblpicture(data) VALUES(@Picture)
But the problem is that the value is not sended to the database.
Is there someone that can help me with it?
Greets


Reply With Quote

