FbDataAdapter.FbCommand.Parameters.AddRange() Method Infinite Loop
------------------------------------------------------------------
Key: DNET-138
URL: http://tracker.firebirdsql.org/browse/DNET-138
Project: .NET Data provider
Issue Type: Bug
Components: ADO.NET Provider
Environment: Windows Xp, developing in Visual Studio
(8.0.50727.762)(C#), running Embedded Firebird 2.0.3.12981-1
Reporter: Brian Liedtke
Assignee: Carlos Guzman Alvarez
Priority: Minor
Attempting to add an array of FbParameters to a FbDataAdapter.Command using the
AddRange() method. This caused
a StackOverflow. Modified to use the Add() method iterating through each array
element and it works fine.
Code that broke
private FbDataAdapter hda = null;
private FbParameter[] Params =
{
new FbParameter("@person_id", FbDbType.Integer, sizeof(int),
"person_id"),
new FbParameter("@first_name", FbDbType.VarChar,
Defaults.Person.FirstNameLen, "first_name"),
new FbParameter("@last_name", FbDbType.VarChar,
Defaults.Person.LastNameLen, "last_name"),
new FbParameter("@nick_name", FbDbType.VarChar,
Defaults.Person.NickNameLen, "nick_name"),
new FbParameter("@name_prefix", FbDbType.VarChar,
Defaults.Person.NamePrefixLen, "name_prefix"),
new FbParameter("@name_suffix", FbDbType.VarChar,
Defaults.Person.NameSuffixLen, "name_suffix"),
new FbParameter("@chgdate", FbDbType.Date, sizeof(int), "chgdate")
};
public FamilyData(Database DB)
{
this.hda = new FbDataAdapter(HusbandSelectSql, DB.Conn);
this.hda.SelectCommand.Parameters.Add("@family_id",
FbDbType.Integer);
this.hda.InsertCommand = new FbCommand(InsertPersonSql, DB.Conn);
this.hda.InsertCommand.Parameters.AddRange(Params);
...........
}
The AddRange() causes a stack overfloe.
Substituted the AddRange() call on the last line to
for (int i = 0; i < Params.Length; i++)
this.hda.InsertCommand.Parameters.Add(Params[i]);
and it runs correctly.
So, I believe there is a problem in the AddRange() method.
Not using FbCommandBuilder to generate the Insert, Delete, Update commands
because
HusbandSelectSql is a multitable select.
If you want me to look at it I will, but I am on a deadline with this project
and it will be awhile before I can
get to it.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider