[Mono-bugs] [Bug 77225][Wis] New - SqlDataAdapter Update
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Jan 12 11:25:55 EST 2006
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by sluca at hotmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=77225
--- shadow/77225 2006-01-12 11:25:55.000000000 -0500
+++ shadow/77225.tmp.13053 2006-01-12 11:25:55.000000000 -0500
@@ -0,0 +1,99 @@
+Bug#: 77225
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Sys.Data
+AssignedTo: tsenganal at novell.com
+ReportedBy: sluca at hotmail.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: SqlDataAdapter Update
+
+I'm using Mono 1.1.13, but the problem was the same with Mono 1.1.10.
+
+Adding multiple records to a tables i've got the following error.
+The thing i don't understand is why if i add 1 record everything goes
+Ok ??
+The problem seems to be the Update method when i insert more than 1
+row.
+
+
+Steps to reproduce the problem:
+Just add some rows to a table and execute the Update command.
+The code i use is like this
+----------------------------------------------------------------
+ DataSet dsSql = new DataSet();
+ tblDa = new SqlDataAdapter("SELECT * FROM
+test",Test.Gcon_ConnectLDB);
+
+ SqlCommandBuilder cb = new SqlCommandBuilder(tblDa);
+ tblDa.Fill(dsSql,"test");
+
+ row_rsInput = dsSql.Tables[0].NewRow();
+
+ row_rsInput["tmp01_idcard"] = "1111";
+ row_rsInput["tmp01_iduser"] = "111";
+
+ dsSql.Tables[0].Rows.Add(row_rsInput);
+
+ row_rsInput = dsSql.Tables[0].NewRow();
+
+
+ row_rsInput["tmp01_idcard"] = "2222";
+ row_rsInput["tmp01_iduser"] = "222";
+
+ dsSql.Tables[0].Rows.Add(row_rsInput);
+
+ tblDa.Update(dsSql,"test");
+
+----------------------------------------------------
+The Error Is the Following
+-----------------------------------------------------
+System.Data.SqlClient.SqlException: The variable name '@p1' has already
+been
+declared. Variable names must be unique within a query batch or stored
+
+procedure.
+in <0x000a0> System.Data.SqlClient.SqlConnection:ErrorHandler
+(System.Object
+sender, Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs e)
+in (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_object_TdsInternalErrorMessageEventArg
+s
+
+(object,Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
+in <0x0001d> Mono.Data.Tds.Protocol.Tds:OnTdsErrorMessage
+(Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs e)
+in <0x001aa> Mono.Data.Tds.Protocol.Tds:ProcessMessage
+(TdsPacketSubType
+subType)
+in <0x0010e> Mono.Data.Tds.Protocol.Tds:ProcessSubPacket ()
+in <0x00045> Mono.Data.Tds.Protocol.Tds:NextResult ()
+in <0x0004b> System.Data.SqlClient.SqlDataReader:NextResult ()
+in (wrapper remoting-invoke-with-check)
+System.Data.SqlClient.SqlDataReader:NextResult ()
+in <0x0007f> System.Data.SqlClient.SqlDataReader:.ctor
+(System.Data.SqlClient.SqlCommand command)
+in (wrapper remoting-invoke-with-check)
+System.Data.SqlClient.SqlDataReader:.ctor
+(System.Data.SqlClient.SqlCommand)
+in <0x00061> System.Data.SqlClient.SqlCommand:ExecuteReader
+(CommandBehavior
+behavior)
+
+------------------------------------------------------
+Expected Results:
+
+
+How often does this happen?
+Always when i try to add more than one row
+
+Additional Information:
+Same Problem also on Linux (Fedora Core 2)
More information about the mono-bugs
mailing list