Hi

I get an exception that says parameter mismatch when I try to insert records using the .NET provider.
I checked on the columns and its type and it is fine.

If I add the command parameters then the exception does not occur, but the values in the table are incorrect values.

Below is the actual code..

                        DataTable table = new DataTable("RESULTSTABLE");
                        table.Columns.Add("OBJECTOID", typeof(int));
                        table.Columns.Add("NRDEST", typeof(int));
                        table.Columns.Add("STATUS", typeof(int));

                        int start = System.Environment.TickCount;

                        for (int i = 0; i < 1; i++)
                        {
                                DataRow row = table.NewRow();
                                row["OBJECTOID"] = (int)(i + start);
                                row["NRDEST"] = (int)(i + start);
                                row["STATUS"] = (int)(i + start);
                                table.Rows.Add(row);
                        }

                        FbTransaction transaction = connection.BeginTransaction();

                        FbCommand command = new FbCommand("INSERT_RESULTS", connection, transaction);
                        command.CommandType = CommandType.StoredProcedure;
                       
//                        command.Parameters.Add("@OBJECTOID", FbDbType.Integer, 4, "OBJECTOID").Direction = ParameterDirection.Input;
//                        command.Parameters.Add("@NRDEST", FbDbType.Integer, 4, "NRDEST").Direction = ParameterDirection.Input;
//                        command.Parameters.Add("@STATUS", FbDbType.Integer, 4, "STATUS").Direction = ParameterDirection.Input;

                        FbDataAdapter adapter = new FbDataAdapter(command);
                        adapter.InsertCommand = command;
                        adapter.Update(table);

                        transaction.Commit();

Please suggest..

Thank you

Venki
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to