Erro inserindo no banco de dados mysql
Seguinte:
Galera, to com o seguinte problema no meu código... quando tento inserir alguma coisa no banco de dados dá erro...
O engraçado é que ora aparece um erro ora outro... os dois erros que já apareceram foram:
Erro de leitura no banco de dados : You have an error in your SQL syntax;check the manual that corresponds to your MySQL server verison for the right syntax to use near 'P' at line 1
e
System.IndexOutOfRangeException: Parameter index is out of range.at MySql.Data.MySqlClient.MySqlParameterCollection.CheckIndex(Int32 index) at MySql.Data.MySqlClient.MySqlParameterCollection.GetParameter(Int32 index) at MySql.Data.MySqlClient.MySqlParameterCollection.get_Item(Int32 index) at MySql.Data.MySqlClient.Statement.SerializeParameter(MySqlParameterCollecti on parameters, MySqlPacket packet, String parmName, Int32 parameterIndex) at MySql.Data.MySqlClient.Statement.InternalBindParameters(String sql, MySqlP arameterCollection parameters, MySqlPacket packet) at MySql.Data.MySqlClient.Statement.BindParameters() at MySql.Data.MySqlClient.PreparableStatement.Execute() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior ) at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior be havior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandB ehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand co mmand, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startR ecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at TCPServidor.Module1.TCPServidor.Main()
Alguem tem alguma dica?
Discussão (19)
Carregando comentários...