You might be right, but I don't have a boolean in insert statement. The error appear when the function reach the line "cmdInsert.ExecuteNonQuery()". I do have boolean function, but could that generate the error?