2 // SqlDataAdapterTest.cs - NUnit Test Cases for testing the
3 // SqlDataAdapter class
5 // Gert Driesen (drieseng@users.sourceforge.net)
7 // Copyright (c) 2007 Gert Driesen
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Data.SqlClient;
33 using System.Data.Odbc;
36 using NUnit.Framework;
38 namespace MonoTests.System.Data.SqlClient
41 public class SqlDataAdapterTest
43 [Test] // SqlDataAdapter ()
44 public void Constructor1 ()
46 SqlDataAdapter da = new SqlDataAdapter ();
47 Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
48 Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
49 Assert.IsNull (da.Container, "#3");
50 Assert.IsFalse (da.ContinueUpdateOnError, "#4");
51 Assert.IsNull (da.DeleteCommand, "#5");
52 Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
53 Assert.IsNull (da.InsertCommand, "#7");
54 Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
55 Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
56 Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
57 Assert.IsNull (da.SelectCommand, "#11");
58 Assert.IsNull (da.Site, "#12");
59 Assert.IsNotNull (da.TableMappings, "#13");
60 Assert.AreEqual (0, da.TableMappings.Count, "#14");
61 Assert.AreEqual (1, da.UpdateBatchSize, "#15");
62 Assert.IsNull (da.UpdateCommand, "#16");
65 [Test] // SqlDataAdapter (SqlCommand)
66 #if FEATURE_NO_BSD_SOCKETS
67 [ExpectedException (typeof (PlatformNotSupportedException))]
69 public void Constructor2 ()
71 SqlCommand cmd = new SqlCommand ();
72 SqlDataAdapter da = new SqlDataAdapter (cmd);
73 Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
74 Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
75 Assert.IsNull (da.Container, "#3");
76 Assert.IsFalse (da.ContinueUpdateOnError, "#4");
77 Assert.IsNull (da.DeleteCommand, "#5");
78 Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
79 Assert.IsNull (da.InsertCommand, "#7");
80 Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
81 Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
82 Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
83 Assert.IsNotNull (da.SelectCommand, "#11");
84 Assert.AreSame (cmd, da.SelectCommand, "#12");
85 Assert.IsNull (da.Site, "#13");
86 Assert.IsNotNull (da.TableMappings, "#14");
87 Assert.AreEqual (0, da.TableMappings.Count, "#15");
88 Assert.AreEqual (1, da.UpdateBatchSize, "#16");
89 Assert.IsNull (da.UpdateCommand, "#17");
92 [Test] // SqlDataAdapter (SqlCommand)
93 public void Constructor2_SelectCommand_Null ()
95 SqlDataAdapter da = new SqlDataAdapter ((SqlCommand) null);
96 Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
97 Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
98 Assert.IsNull (da.Container, "#3");
99 Assert.IsFalse (da.ContinueUpdateOnError, "#4");
100 Assert.IsNull (da.DeleteCommand, "#5");
101 Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
102 Assert.IsNull (da.InsertCommand, "#7");
103 Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
104 Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
105 Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
106 Assert.IsNull (da.SelectCommand, "#11");
107 Assert.IsNull (da.Site, "#12");
108 Assert.IsNotNull (da.TableMappings, "#13");
109 Assert.AreEqual (0, da.TableMappings.Count, "#14");
110 Assert.AreEqual (1, da.UpdateBatchSize, "#15");
111 Assert.IsNull (da.UpdateCommand, "#16");
114 [Test] // SqlDataAdapter (string, SqlConnection)
115 #if FEATURE_NO_BSD_SOCKETS
116 [ExpectedException (typeof (PlatformNotSupportedException))]
118 public void Constructor3 ()
120 string selectCommandText = "SELECT * FROM Authors";
121 SqlConnection selectConnection = new SqlConnection ();
123 SqlDataAdapter da = new SqlDataAdapter (selectCommandText,
125 Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
126 Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
127 Assert.IsNull (da.Container, "#3");
128 Assert.IsFalse (da.ContinueUpdateOnError, "#4");
129 Assert.IsNull (da.DeleteCommand, "#5");
130 Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
131 Assert.IsNull (da.InsertCommand, "#7");
132 Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
133 Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
134 Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
135 Assert.IsNotNull (da.SelectCommand, "#11");
136 Assert.AreSame (selectCommandText, da.SelectCommand.CommandText, "#12");
137 Assert.AreSame (selectConnection, da.SelectCommand.Connection, "#13");
138 Assert.IsNull (da.Site, "#14");
139 Assert.IsNotNull (da.TableMappings, "#15");
140 Assert.AreEqual (0, da.TableMappings.Count, "#16");
141 Assert.AreEqual (1, da.UpdateBatchSize, "#17");
142 Assert.IsNull (da.UpdateCommand, "#18");
145 [Test] // SqlDataAdapter (string, SqlConnection)
146 #if FEATURE_NO_BSD_SOCKETS
147 [ExpectedException (typeof (PlatformNotSupportedException))]
149 public void Constructor3_SelectCommandText_Null ()
151 SqlConnection selectConnection = new SqlConnection ();
153 SqlDataAdapter da = new SqlDataAdapter ((string) null,
155 Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
156 Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
157 Assert.IsNull (da.Container, "#3");
158 Assert.IsFalse (da.ContinueUpdateOnError, "#4");
159 Assert.IsNull (da.DeleteCommand, "#5");
160 Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
161 Assert.IsNull (da.InsertCommand, "#7");
162 Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
163 Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
164 Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
165 Assert.IsNotNull (da.SelectCommand, "#11");
166 Assert.IsNotNull (da.SelectCommand.CommandText, "#12");
167 Assert.AreEqual (string.Empty, da.SelectCommand.CommandText, "#13");
168 Assert.AreSame (selectConnection, da.SelectCommand.Connection, "#14");
169 Assert.IsNull (da.Site, "#15");
170 Assert.IsNotNull (da.TableMappings, "#16");
171 Assert.AreEqual (0, da.TableMappings.Count, "#17");
172 Assert.AreEqual (1, da.UpdateBatchSize, "#18");
173 Assert.IsNull (da.UpdateCommand, "#19");
176 [Test] // SqlDataAdapter (string, SqlConnection)
177 #if FEATURE_NO_BSD_SOCKETS
178 [ExpectedException (typeof (PlatformNotSupportedException))]
180 public void Constructor3_SelectConnection_Null ()
182 string selectCommandText = "SELECT * FROM Authors";
184 SqlDataAdapter da = new SqlDataAdapter (selectCommandText,
185 (SqlConnection) null);
186 Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
187 Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
188 Assert.IsNull (da.Container, "#3");
189 Assert.IsFalse (da.ContinueUpdateOnError, "#4");
190 Assert.IsNull (da.DeleteCommand, "#5");
191 Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
192 Assert.IsNull (da.InsertCommand, "#7");
193 Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
194 Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
195 Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
196 Assert.IsNotNull (da.SelectCommand, "#11");
197 Assert.AreSame (selectCommandText, da.SelectCommand.CommandText, "#12");
198 Assert.IsNull (da.SelectCommand.Connection, "#13");
199 Assert.IsNull (da.Site, "#14");
200 Assert.IsNotNull (da.TableMappings, "#15");
201 Assert.AreEqual (0, da.TableMappings.Count, "#16");
202 Assert.AreEqual (1, da.UpdateBatchSize, "#17");
203 Assert.IsNull (da.UpdateCommand, "#18");
206 [Test] // SqlDataAdapter (string, string)]
207 #if FEATURE_NO_BSD_SOCKETS
208 [ExpectedException (typeof (PlatformNotSupportedException))]
210 public void Constructor4 ()
212 string selectCommandText = "SELECT * FROM Authors";
213 string selectConnectionString = "server=SQLSRV;database=Mono";
215 SqlDataAdapter da = new SqlDataAdapter (selectCommandText,
216 selectConnectionString);
217 Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
218 Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
219 Assert.IsNull (da.Container, "#3");
220 Assert.IsFalse (da.ContinueUpdateOnError, "#4");
221 Assert.IsNull (da.DeleteCommand, "#5");
222 Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
223 Assert.IsNull (da.InsertCommand, "#7");
224 Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
225 Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
226 Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
227 Assert.IsNotNull (da.SelectCommand, "#11");
228 Assert.AreSame (selectCommandText, da.SelectCommand.CommandText, "#12");
229 Assert.IsNotNull (da.SelectCommand.Connection, "#13");
230 Assert.AreEqual (selectConnectionString, da.SelectCommand.Connection.ConnectionString, "#14");
231 Assert.IsNull (da.Site, "#15");
232 Assert.IsNotNull (da.TableMappings, "#16");
233 Assert.AreEqual (0, da.TableMappings.Count, "#17");
234 Assert.AreEqual (1, da.UpdateBatchSize, "#18");
235 Assert.IsNull (da.UpdateCommand, "#19");
238 [Test] // SqlDataAdapter (string, string)]
239 #if FEATURE_NO_BSD_SOCKETS
240 [ExpectedException (typeof (PlatformNotSupportedException))]
242 public void Constructor4_SelectCommandText_Null ()
244 string selectConnectionString = "server=SQLSRV;database=Mono";
246 SqlDataAdapter da = new SqlDataAdapter ((string) null,
247 selectConnectionString);
248 Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
249 Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
250 Assert.IsNull (da.Container, "#3");
251 Assert.IsFalse (da.ContinueUpdateOnError, "#4");
252 Assert.IsNull (da.DeleteCommand, "#5");
253 Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
254 Assert.IsNull (da.InsertCommand, "#7");
255 Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
256 Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
257 Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
258 Assert.IsNotNull (da.SelectCommand, "#11");
259 Assert.IsNotNull (da.SelectCommand.CommandText, "#12");
260 Assert.AreEqual (string.Empty, da.SelectCommand.CommandText, "#13");
261 Assert.IsNotNull (da.SelectCommand.Connection, "#14");
262 Assert.AreEqual (selectConnectionString, da.SelectCommand.Connection.ConnectionString, "#15");
263 Assert.IsNull (da.Site, "#16");
264 Assert.IsNotNull (da.TableMappings, "#17");
265 Assert.AreEqual (0, da.TableMappings.Count, "#18");
266 Assert.AreEqual (1, da.UpdateBatchSize, "#19");
267 Assert.IsNull (da.UpdateCommand, "#20");
270 [Test] // SqlDataAdapter (string, string)]
271 #if FEATURE_NO_BSD_SOCKETS
272 [ExpectedException (typeof (PlatformNotSupportedException))]
274 public void Constructor4_SelectConnectionString_Null ()
276 string selectCommandText = "SELECT * FROM Authors";
278 SqlDataAdapter da = new SqlDataAdapter (selectCommandText,
280 Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
281 Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
282 Assert.IsNull (da.Container, "#3");
283 Assert.IsFalse (da.ContinueUpdateOnError, "#4");
284 Assert.IsNull (da.DeleteCommand, "#5");
285 Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
286 Assert.IsNull (da.InsertCommand, "#7");
287 Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
288 Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
289 Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
290 Assert.IsNotNull (da.SelectCommand, "#11");
291 Assert.AreSame (selectCommandText, da.SelectCommand.CommandText, "#12");
292 Assert.IsNotNull (da.SelectCommand.Connection, "#14");
293 Assert.AreEqual (string.Empty, da.SelectCommand.Connection.ConnectionString, "#15");
294 Assert.IsNull (da.Site, "#16");
295 Assert.IsNotNull (da.TableMappings, "#17");
296 Assert.AreEqual (0, da.TableMappings.Count, "#18");
297 Assert.AreEqual (1, da.UpdateBatchSize, "#19");
298 Assert.IsNull (da.UpdateCommand, "#20");
302 #if FEATURE_NO_BSD_SOCKETS
303 [ExpectedException (typeof (PlatformNotSupportedException))]
305 public void DeleteCommand ()
307 SqlDataAdapter da = new SqlDataAdapter ();
308 SqlCommand cmd1 = new SqlCommand ();
309 SqlCommand cmd2 = new SqlCommand ();
311 da.DeleteCommand = cmd1;
312 Assert.AreSame (cmd1, da.DeleteCommand, "#1");
313 da.DeleteCommand = cmd2;
314 Assert.AreSame (cmd2, da.DeleteCommand, "#2");
315 da.DeleteCommand = null;
316 Assert.IsNull (da.DeleteCommand, "#3");
320 #if FEATURE_NO_BSD_SOCKETS
321 [ExpectedException (typeof (PlatformNotSupportedException))]
323 public void Dispose ()
325 SqlDataAdapter da = new SqlDataAdapter ();
326 da.DeleteCommand = new SqlCommand ();
327 da.InsertCommand = new SqlCommand ();
328 da.SelectCommand = new SqlCommand ();
329 da.UpdateCommand = new SqlCommand ();
332 Assert.IsNull (da.DeleteCommand, "#1");
333 Assert.IsNull (da.InsertCommand, "#2");
334 Assert.IsNull (da.SelectCommand, "#3");
335 Assert.IsNotNull (da.TableMappings, "#4");
336 Assert.AreEqual (0, da.TableMappings.Count, "#5");
337 Assert.IsNull (da.UpdateCommand, "#6");
341 #if FEATURE_NO_BSD_SOCKETS
342 [ExpectedException (typeof (PlatformNotSupportedException))]
344 public void InsertCommand ()
346 SqlDataAdapter da = new SqlDataAdapter ();
347 SqlCommand cmd1 = new SqlCommand ();
348 SqlCommand cmd2 = new SqlCommand ();
350 da.InsertCommand = cmd1;
351 Assert.AreSame (cmd1, da.InsertCommand, "#1");
352 da.InsertCommand = cmd2;
353 Assert.AreSame (cmd2, da.InsertCommand, "#2");
354 da.InsertCommand = null;
355 Assert.IsNull (da.InsertCommand, "#3");
359 #if FEATURE_NO_BSD_SOCKETS
360 [ExpectedException (typeof (PlatformNotSupportedException))]
362 public void SelectCommand ()
364 SqlDataAdapter da = new SqlDataAdapter ();
365 SqlCommand cmd1 = new SqlCommand ();
366 SqlCommand cmd2 = new SqlCommand ();
368 da.SelectCommand = cmd1;
369 Assert.AreSame (cmd1, da.SelectCommand, "#1");
370 da.SelectCommand = cmd2;
371 Assert.AreSame (cmd2, da.SelectCommand, "#2");
372 da.SelectCommand = null;
373 Assert.IsNull (da.SelectCommand, "#3");
377 public void UpdateBatchSize ()
379 SqlDataAdapter da = new SqlDataAdapter ();
380 da.UpdateBatchSize = 0;
381 Assert.AreEqual (0, da.UpdateBatchSize, "#1");
382 da.UpdateBatchSize = int.MaxValue;
383 Assert.AreEqual (int.MaxValue, da.UpdateBatchSize, "#2");
384 da.UpdateBatchSize = 1;
385 Assert.AreEqual (1, da.UpdateBatchSize, "#3");
389 public void UpdateBatchSize_Negative ()
391 SqlDataAdapter da = new SqlDataAdapter ();
393 da.UpdateBatchSize = -1;
395 } catch (ArgumentOutOfRangeException ex) {
396 Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#2");
397 Assert.IsNull (ex.InnerException, "#3");
398 Assert.IsNotNull (ex.Message, "#4");
399 Assert.IsNotNull (ex.ParamName, "#5");
400 Assert.AreEqual ("UpdateBatchSize", ex.ParamName, "#6");
405 #if FEATURE_NO_BSD_SOCKETS
406 [ExpectedException (typeof (PlatformNotSupportedException))]
408 public void UpdateCommand ()
410 SqlDataAdapter da = new SqlDataAdapter ();
411 SqlCommand cmd1 = new SqlCommand ();
412 SqlCommand cmd2 = new SqlCommand ();
414 da.UpdateCommand = cmd1;
415 Assert.AreSame (cmd1, da.UpdateCommand, "#1");
416 da.UpdateCommand = cmd2;
417 Assert.AreSame (cmd2, da.UpdateCommand, "#2");
418 da.UpdateCommand = null;
419 Assert.IsNull (da.UpdateCommand, "#3");
424 public void DeleteCommand_IDbDataAdapter ()
426 IDbDataAdapter da = new SqlDataAdapter ();
427 SqlCommand cmd1 = new SqlCommand ();
428 SqlCommand cmd2 = new SqlCommand ();
430 da.DeleteCommand = cmd1;
431 Assert.AreSame (cmd1, da.DeleteCommand, "#A1");
432 da.DeleteCommand = cmd2;
433 Assert.AreSame (cmd2, da.DeleteCommand, "#A2");
434 da.DeleteCommand = null;
435 Assert.IsNull (da.DeleteCommand, "#A3");
438 da.DeleteCommand = new OdbcCommand ();
440 } catch (InvalidCastException ex) {
441 Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
442 Assert.IsNull (ex.InnerException, "#B3");
443 Assert.IsNotNull (ex.Message, "#B4");
449 public void InsertCommand_IDbDataAdapter ()
451 IDbDataAdapter da = new SqlDataAdapter ();
452 SqlCommand cmd1 = new SqlCommand ();
453 SqlCommand cmd2 = new SqlCommand ();
455 da.InsertCommand = cmd1;
456 Assert.AreSame (cmd1, da.InsertCommand, "#A1");
457 da.InsertCommand = cmd2;
458 Assert.AreSame (cmd2, da.InsertCommand, "#A2");
459 da.InsertCommand = null;
460 Assert.IsNull (da.InsertCommand, "#A3");
463 da.InsertCommand = new OdbcCommand ();
465 } catch (InvalidCastException ex) {
466 Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
467 Assert.IsNull (ex.InnerException, "#B3");
468 Assert.IsNotNull (ex.Message, "#B4");
473 public void SelectCommand_IDbDataAdapter ()
475 IDbDataAdapter da = new SqlDataAdapter ();
476 SqlCommand cmd1 = new SqlCommand ();
477 SqlCommand cmd2 = new SqlCommand ();
479 da.SelectCommand = cmd1;
480 Assert.AreSame (cmd1, da.SelectCommand, "#A1");
481 da.SelectCommand = cmd2;
482 Assert.AreSame (cmd2, da.SelectCommand, "#A2");
483 da.SelectCommand = null;
484 Assert.IsNull (da.SelectCommand, "#A3");
487 da.SelectCommand = new OdbcCommand ();
489 } catch (InvalidCastException ex) {
490 Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
491 Assert.IsNull (ex.InnerException, "#B3");
492 Assert.IsNotNull (ex.Message, "#B4");
497 public void UpdateCommand_IDbDataAdapter ()
499 IDbDataAdapter da = new SqlDataAdapter ();
500 SqlCommand cmd1 = new SqlCommand ();
501 SqlCommand cmd2 = new SqlCommand ();
503 da.UpdateCommand = cmd1;
504 Assert.AreSame (cmd1, da.UpdateCommand, "#A1");
505 da.UpdateCommand = cmd2;
506 Assert.AreSame (cmd2, da.UpdateCommand, "#A2");
507 da.UpdateCommand = null;
508 Assert.IsNull (da.UpdateCommand, "#A3");
511 da.UpdateCommand = new OdbcCommand ();
513 } catch (InvalidCastException ex) {
514 Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
515 Assert.IsNull (ex.InnerException, "#B3");
516 Assert.IsNotNull (ex.Message, "#B4");