Author: senga
Date: 2006-01-17 04:07:43 -0500 (Tue, 17 Jan 2006)
New Revision: 55668

Modified:
   trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
   trunk/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs
   trunk/mcs/class/System.Data/Test/ProviderTests/ChangeLog
   
trunk/mcs/class/System.Data/Test/ProviderTests/System.Data.SqlClient/ChangeLog
   
trunk/mcs/class/System.Data/Test/ProviderTests/System.Data.SqlClient/SqlCommandBuilderTest.cs
   trunk/mcs/class/System.Data/Test/ProviderTests/sqlserver.config
Log:
2006-01-17  Senganal T  <[EMAIL PROTECTED]>

        * Test/ProviderTests/sqlserver.config : Modified the default login and 
password to 'monotester'

        * Test/ProviderTests/System.Data.SqlClient/SqlCommandBuilderTest.cs : 
Added testcase for bug #77225

        * System.Data.SqlClient/SqlCommandBuilder.cs
                - Modified CreateNewCommand () : Clean up any existing 
parameter list
                before reusing the command.Fixes #77225



Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog 2006-01-17 
07:34:20 UTC (rev 55667)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog 2006-01-17 
09:07:43 UTC (rev 55668)
@@ -1,3 +1,9 @@
+2006-01-17  Senganal T  <[EMAIL PROTECTED]>
+
+       * SqlCommandBuilder.cs
+               - Modified CreateNewCommand () : Clean up any existing 
parameter list
+               before reusing the command.Fixes #77225
+
 2005-11-24  Senganal T  <[EMAIL PROTECTED]>
 
        * SqlConnection.cs 

Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs      
2006-01-17 07:34:20 UTC (rev 55667)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs      
2006-01-17 09:07:43 UTC (rev 55668)
@@ -312,6 +312,7 @@
                        }
                        command.CommandType = CommandType.Text;
                        command.UpdatedRowSource = UpdateRowSource.None;
+                       command.Parameters.Clear ();
                }
 
                private SqlCommand CreateUpdateCommand (DataRow row, 
DataTableMapping tableMapping) 

Modified: trunk/mcs/class/System.Data/Test/ProviderTests/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/Test/ProviderTests/ChangeLog    2006-01-17 
07:34:20 UTC (rev 55667)
+++ trunk/mcs/class/System.Data/Test/ProviderTests/ChangeLog    2006-01-17 
09:07:43 UTC (rev 55668)
@@ -1,3 +1,7 @@
+2006-01-17  Senganal T  <[EMAIL PROTECTED]>
+
+       * sqlserver.config : Modified the default login and password to 
'monotester'
+
 2005-11-05  Kornél Pál  <[EMAIL PROTECTED]>
 
        * app-net_2_0.config: Updated assembly versions to 2.0.0.0 (2.0 RTM).

Modified: 
trunk/mcs/class/System.Data/Test/ProviderTests/System.Data.SqlClient/ChangeLog
===================================================================
--- 
trunk/mcs/class/System.Data/Test/ProviderTests/System.Data.SqlClient/ChangeLog  
    2006-01-17 07:34:20 UTC (rev 55667)
+++ 
trunk/mcs/class/System.Data/Test/ProviderTests/System.Data.SqlClient/ChangeLog  
    2006-01-17 09:07:43 UTC (rev 55668)
@@ -1,3 +1,7 @@
+2006-01-17  Senganal T  <[EMAIL PROTECTED]>
+
+       * SqlCommandBuilderTest.cs : Added testcase for bug #77225
+
 2005-12-03  Senganal T  <[EMAIL PROTECTED]>
 
        * SqlCommandTest.cs : Added testcase for bug #76880

Modified: 
trunk/mcs/class/System.Data/Test/ProviderTests/System.Data.SqlClient/SqlCommandBuilderTest.cs
===================================================================
--- 
trunk/mcs/class/System.Data/Test/ProviderTests/System.Data.SqlClient/SqlCommandBuilderTest.cs
       2006-01-17 07:34:20 UTC (rev 55667)
+++ 
trunk/mcs/class/System.Data/Test/ProviderTests/System.Data.SqlClient/SqlCommandBuilderTest.cs
       2006-01-17 09:07:43 UTC (rev 55668)
@@ -178,6 +178,32 @@
 
                // FIXME:  Add tests for examining RowError
                // FIXME: Add test for ContinueUpdateOnError property
+               
+               [Test]
+               public void CheckParameters_BuiltCommand ()
+               {
+                       using (IDbConnection conn = 
ConnectionManager.Singleton.Connection) {
+                               SqlDataAdapter adapter = new SqlDataAdapter 
("select id,type_varchar from string_family", (SqlConnection)conn);
+                               SqlCommandBuilder cb = new 
SqlCommandBuilder(adapter);
+                               DataSet ds = new DataSet ();
+                               adapter.Fill(ds);
 
+                               Assert.AreEqual (2, 
cb.GetInsertCommand().Parameters.Count, "#1");
+
+                               DataRow row_rsInput = ds.Tables[0].NewRow();
+                               row_rsInput["id"] = 100;
+                               row_rsInput["type_varchar"] = "ttt";
+                               ds.Tables[0].Rows.Add(row_rsInput);
+
+                               Assert.AreEqual (2, 
cb.GetInsertCommand().Parameters.Count, "#2");
+
+                               row_rsInput = ds.Tables[0].NewRow();
+                               row_rsInput["id"] = 101;
+                               row_rsInput["type_varchar"] = "ttt";
+                               ds.Tables[0].Rows.Add(row_rsInput);
+
+                               Assert.AreEqual (2, 
cb.GetInsertCommand().Parameters.Count, "#3");
+                       }
+               }
        }
 }

Modified: trunk/mcs/class/System.Data/Test/ProviderTests/sqlserver.config
===================================================================
--- trunk/mcs/class/System.Data/Test/ProviderTests/sqlserver.config     
2006-01-17 07:34:20 UTC (rev 55667)
+++ trunk/mcs/class/System.Data/Test/ProviderTests/sqlserver.config     
2006-01-17 09:07:43 UTC (rev 55668)
@@ -1,3 +1,3 @@
 <appSettings>
-               <add key="ConnString" 
value="factory=System.Data.SqlClient;server=mono-server;database=monotest;user 
id=sa;password=;" />
+               <add key="ConnString" 
value="factory=System.Data.SqlClient;server=mono-server;database=monotest;user 
id=monotester;password=monotester;" />
 </appSettings>

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to