Error using MySqlParameter
Posted by:
M Varghese
Date: November 20, 2004 01:37AM
I tried to execute code with parameter value, but I always get the error message
column cannot be null
<CODE >
Dim myConnection As New MySqlConnection(ConfigurationSettings.AppSettings("connectionString"))
Dim UserID As Integer
Dim sqlText As String
sqlText = "INSERT INTO test ( t2 ) VALUES ( @t2 )"
Dim myCommand As New MySqlCommand(sqlText, myConnection)
myCommand.CommandType = CommandType.Text
myCommand.Parameters.Add(New MySqlParameter("@t2", MySqlDbType.VarChar, 50, "t2")).Value = "m varghese"
myConnection.Open()
myCommand.ExecuteNonQuery()
****
I am always getting this error column cannot be null.
MySql.Data.MySqlClient.MySqlException: #23000Column 't2' cannot be null at MySql.Data.MySqlClient.Driver.ReadPacket() at MySql.Data.MySqlClient.Driver.Send(DBCmd cmd, Byte[] bytes) at MySql.Data.MySqlClient.InternalConnection.ExecuteCmd(DBCmd cmd, Byte[] buffer, Boolean consume) at MySql.Data.MySqlClient.MySqlCommand.GetNextResultSet(MySqlDataReader reader) at MySql.Data.MySqlClient.MySqlCommand.Consume() at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
M Varghese
Subject
Written By
Posted
Error using MySqlParameter
November 20, 2004 01:37AM
November 20, 2004 03:09PM
November 20, 2004 11:29PM
November 21, 2004 09:23AM
November 21, 2004 05:57PM
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.