-
Notifications
You must be signed in to change notification settings - Fork 1
/
MySql.Data.xml
13918 lines (13567 loc) · 656 KB
/
MySql.Data.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<doc>
<assembly>
<name>MySql.Data</name>
</assembly>
<members>
<member name="T:MySql.Data.MySqlClient.MySqlBulkLoader">
<summary>
</summary>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.Connection">
<summary>
Gets or sets the connection.
</summary>
<value>The connection.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.FieldTerminator">
<summary>
Gets or sets the field terminator.
</summary>
<value>The field terminator.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.LineTerminator">
<summary>
Gets or sets the line terminator.
</summary>
<value>The line terminator.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.TableName">
<summary>
Gets or sets the name of the table.
</summary>
<value>The name of the table.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.CharacterSet">
<summary>
Gets or sets the character set.
</summary>
<value>The character set.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.FileName">
<summary>
Gets or sets the name of the file.
</summary>
<value>The name of the file.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.Timeout">
<summary>
Gets or sets the timeout.
</summary>
<value>The timeout.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.Local">
<summary>
Gets or sets a value indicating whether the filename that is to be loaded
is local to the client or not
</summary>
<value><c>true</c> if local; otherwise, <c>false</c>.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.NumberOfLinesToSkip">
<summary>
Gets or sets the number of lines to skip.
</summary>
<value>The number of lines to skip.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.LinePrefix">
<summary>
Gets or sets the line prefix.
</summary>
<value>The line prefix.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.FieldQuotationCharacter">
<summary>
Gets or sets the field quotation character.
</summary>
<value>The field quotation character.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.FieldQuotationOptional">
<summary>
Gets or sets a value indicating whether [field quotation optional].
</summary>
<value>
<c>true</c> if [field quotation optional]; otherwise, <c>false</c>.
</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.EscapeCharacter">
<summary>
Gets or sets the escape character.
</summary>
<value>The escape character.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.ConflictOption">
<summary>
Gets or sets the conflict option.
</summary>
<value>The conflict option.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.Priority">
<summary>
Gets or sets the priority.
</summary>
<value>The priority.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.Columns">
<summary>
Gets the columns.
</summary>
<value>The columns.</value>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlBulkLoader.Expressions">
<summary>
Gets the expressions.
</summary>
<value>The expressions.</value>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlBulkLoader.Load">
<summary>
Execute the load operation
</summary>
<returns>The number of rows inserted.</returns>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlBulkLoader.LoadAsync">
<summary>
Async version of Load
</summary>
<returns>The number of rows inserted.</returns>
</member>
<member name="T:MySql.Data.MySqlClient.MySqlBulkLoaderPriority">
<summary>
</summary>
</member>
<member name="F:MySql.Data.MySqlClient.MySqlBulkLoaderPriority.None">
<summary>
This is the default and indicates normal priority
</summary>
</member>
<member name="F:MySql.Data.MySqlClient.MySqlBulkLoaderPriority.Low">
<summary>
Low priority will cause the load operation to wait until all readers of the table
have finished. This only affects storage engines that use only table-level locking
such as MyISAM, Memory, and Merge.
</summary>
</member>
<member name="F:MySql.Data.MySqlClient.MySqlBulkLoaderPriority.Concurrent">
<summary>
Concurrent priority is only relevant for MyISAM tables and signals that if the table
has no free blocks in the middle that other readers can retrieve data from the table
while the load operation is happening.
</summary>
</member>
<member name="T:MySql.Data.MySqlClient.MySqlBulkLoaderConflictOption">
<summary>
</summary>
</member>
<member name="F:MySql.Data.MySqlClient.MySqlBulkLoaderConflictOption.None">
<summary>
This is the default and indicates normal operation. In the event of a LOCAL load, this
is the same as ignore. When the data file is on the server, then a key conflict will
cause an error to be thrown and the rest of the data file ignored.
</summary>
</member>
<member name="F:MySql.Data.MySqlClient.MySqlBulkLoaderConflictOption.Replace">
<summary>
Replace column values when a key conflict occurs.
</summary>
</member>
<member name="F:MySql.Data.MySqlClient.MySqlBulkLoaderConflictOption.Ignore">
<summary>
Ignore any rows where the primary key conflicts.
</summary>
</member>
<member name="T:MySql.Data.MySqlClient.CharSetMap">
<summary>
Summary description for CharSetMap.
</summary>
</member>
<member name="M:MySql.Data.MySqlClient.CharSetMap.GetEncoding(MySql.Data.Common.DBVersion,System.String)">
<summary>
Returns the text encoding for a given MySQL character set name
</summary>
<param name="version">Version of the connection requesting the encoding</param>
<param name="charSetName">Name of the character set to get the encoding for</param>
<returns>Encoding object for the given character set name</returns>
</member>
<member name="M:MySql.Data.MySqlClient.CharSetMap.InitializeMapping">
<summary>
Initializes the mapping.
</summary>
</member>
<member name="T:MySql.Data.MySqlClient.MySqlCommand">
<summary>Represents a SQL statement to execute against a MySQL database. This class cannot be inherited.</summary><remarks>
<B>MySqlCommand</B> features the following methods for executing commands at a MySQL database:
<list type="table">
<listheader>
<term>Item</term>
<term>Description</term>
</listheader>
<item>
<term>
<a href="MySql.Data.MySqlClient.MySqlCommand.ExecuteReader_overloads.html">ExecuteReader</a>
</term>
<description>Executes commands that return rows.</description>
</item>
<item>
<term>
<a href="MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery.html">ExecuteNonQuery</a>
</term>
<description>Executes commands such as SQL INSERT, DELETE, and UPDATE statements.</description>
</item>
<item>
<term>
<a href="MySql.Data.MySqlClient.MySqlCommand.ExecuteScalar.html">ExecuteScalar</a>
</term>
<description>Retrieves a single value (for example, an aggregate value) from a database.</description>
</item>
</list>
You can reset the <B>CommandText</B> property and reuse the <B>MySqlCommand</B>
object. However, you must close the <A href="MySql.Data.MySqlClient.MySqlDataReader.html">MySqlDataReader</A>
before you can execute a new or previous command.
If a <A href="MySql.Data.MySqlClient.MySqlException.html">MySqlException</A> is
generated by the method executing a <B>MySqlCommand</B>, the <A href="MySql.Data.MySqlClient.MySqlConnection.html">MySqlConnection</A>
remains open. It is the responsibility of the programmer to close the connection.
<note>
Using the '@' symbol for paramters is now the preferred approach although the old pattern of using
'?' is still supported. Please be aware though that using '@' can cause conflicts when user variables
are also used. To help with this situation please see the documentation on the 'allow user variables'
connection string option. The 'old syntax' connection string option has now been deprecated.
</note>
</remarks><example>
The following example creates a <A href="frlrfsystemdatasqlclientsqlcommandclasstopic.htm">MySqlCommand</A> and
a <B>MySqlConnection</B>. The <B>MySqlConnection</B> is opened and set as the <A href="frlrfsystemdatasqlclientsqlcommandclassconnectiontopic.htm">Connection</A>
for the <B>MySqlCommand</B>. The example then calls <A href="frlrfsystemdatasqlclientsqlcommandclassexecutenonquerytopic.htm">ExecuteNonQuery</A>,
and closes the connection. To accomplish this, the <B>ExecuteNonQuery</B> is
passed a connection string and a query string that is a SQL INSERT
statement.
<code lang="vbnet">
Public Sub InsertRow(myConnectionString As String)
" If the connection string is null, use a default.
If myConnectionString = "" Then
myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass"
End If
Dim myConnection As New MySqlConnection(myConnectionString)
Dim myInsertQuery As String = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)"
Dim myCommand As New MySqlCommand(myInsertQuery)
myCommand.Connection = myConnection
myConnection.Open()
myCommand.ExecuteNonQuery()
myCommand.Connection.Close()
End Sub
</code>
<code lang="C#">
public void InsertRow(string myConnectionString)
{
// If the connection string is null, use a default.
if(myConnectionString == "")
{
myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass";
}
MySqlConnection myConnection = new MySqlConnection(myConnectionString);
string myInsertQuery = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)";
MySqlCommand myCommand = new MySqlCommand(myInsertQuery);
myCommand.Connection = myConnection;
myConnection.Open();
myCommand.ExecuteNonQuery();
myCommand.Connection.Close();
}
</code>
</example>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.#ctor">
<overloads>
<summary>
Initializes a new instance of the MySqlCommand class.
</summary>
<example>
The following example creates a MySqlCommand and sets some of its properties.
<para />
<note>
This example shows how to use one of the overloaded
versions of the MySqlCommand constructor. For other examples that might be available,
see the individual overload topics.
</note>
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim myConnection As New MySqlConnection _
("Persist Security Info=False;database=test;server=myServer")
myConnection.Open()
Dim myTrans As MySqlTransaction = myConnection.BeginTransaction()
Dim mySelectQuery As String = "SELECT * FROM MyTable"
Dim myCommand As New MySqlCommand(mySelectQuery, myConnection, myTrans)
myCommand.CommandTimeout = 20
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
MySqlConnection myConnection = new MySqlConnection("Persist Security Info=False;
database=test;server=myServer");
myConnection.Open();
MySqlTransaction myTrans = myConnection.BeginTransaction();
string mySelectQuery = "SELECT * FROM myTable";
MySqlCommand myCommand = new MySqlCommand(mySelectQuery, myConnection,myTrans);
myCommand.CommandTimeout = 20;
}
</code>
<code lang="C++">
public:
void CreateMySqlCommand()
{
MySqlConnection* myConnection = new MySqlConnection(S"Persist Security Info=False;
database=test;server=myServer");
myConnection->Open();
MySqlTransaction* myTrans = myConnection->BeginTransaction();
String* mySelectQuery = S"SELECT * FROM myTable";
MySqlCommand* myCommand = new MySqlCommand(mySelectQuery, myConnection, myTrans);
myCommand->CommandTimeout = 20;
};
</code>
</example>
</overloads><summary>
Initializes a new instance of the MySqlCommand class.
</summary><remarks>
The base constructor initializes all fields to their default values. The
following table shows initial property values for an instance of <see cref="T:MySql.Data.MySqlClient.MySqlCommand" />.
<list type="table">
<listheader>
<term>Properties</term>
<term>Initial Value</term>
</listheader>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandText" />
</term>
<term>empty string ("")</term>
</item>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandTimeout" />
</term>
<term>0</term>
</item>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandType" />
</term>
<term>CommandType.Text</term>
</item>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.Connection" />
</term>
<term>Null</term>
</item>
</list>
<para>
You can change the value for any of these properties through a separate call to
the property.
</para>
</remarks><example>
The following example creates a <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> and
sets some of its properties.
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim myCommand As New MySqlCommand()
myCommand.CommandType = CommandType.Text
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
MySqlCommand myCommand = new MySqlCommand();
myCommand.CommandType = CommandType.Text;
}
</code>
</example>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.#ctor(System.String)">
<summary>
Initializes a new instance of the <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> class with the text of the query.
</summary><param name="cmdText">The text of the query.</param><remarks>
When an instance of <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> is created,
the following read/write properties are set to initial values.
<list type="table">
<listheader>
<term>Properties</term>
<term>Initial Value</term>
</listheader>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandText" />
</term>
<term>
<i>cmdText</i>
</term>
</item>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandTimeout" />
</term>
<term>0</term>
</item>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandType" />
</term>
<term>CommandType.Text</term>
</item>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.Connection" />
</term>
<term>Null</term>
</item>
</list>
<para>
You can change the value for any of these properties through a separate call to
the property.
</para>
</remarks><example>
The following example creates a <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> and
sets some of its properties.
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim sql as String = "SELECT * FROM mytable"
Dim myCommand As New MySqlCommand(sql)
myCommand.CommandType = CommandType.Text
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
string sql = "SELECT * FROM mytable";
MySqlCommand myCommand = new MySqlCommand(sql);
myCommand.CommandType = CommandType.Text;
}
</code>
</example>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.#ctor(System.String,MySql.Data.MySqlClient.MySqlConnection)">
<summary>
Initializes a new instance of the <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> class
with the text of the query and a <see cref="T:MySql.Data.MySqlClient.MySqlConnection" />.
</summary><param name="cmdText">The text of the query.</param><param name="connection">
A <see cref="T:MySql.Data.MySqlClient.MySqlConnection" /> that represents the
connection to an instance of SQL Server.
</param><remarks>
When an instance of <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> is created,
the following read/write properties are set to initial values.
<list type="table">
<listheader>
<term>Properties</term>
<term>Initial Value</term>
</listheader>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandText" />
</term>
<term>
<i>cmdText</i>
</term>
</item>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandTimeout" />
</term>
<term>0</term>
</item>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandType" />
</term>
<term>CommandType.Text</term>
</item>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.Connection" />
</term>
<term>
<i>connection</i>
</term>
</item>
</list>
<para>
You can change the value for any of these properties through a separate call to
the property.
</para>
</remarks><example>
The following example creates a <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> and
sets some of its properties.
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim conn as new MySqlConnection("server=myServer")
Dim sql as String = "SELECT * FROM mytable"
Dim myCommand As New MySqlCommand(sql, conn)
myCommand.CommandType = CommandType.Text
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
MySqlConnection conn = new MySqlConnection("server=myserver")
string sql = "SELECT * FROM mytable";
MySqlCommand myCommand = new MySqlCommand(sql, conn);
myCommand.CommandType = CommandType.Text;
}
</code>
</example>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.#ctor(System.String,MySql.Data.MySqlClient.MySqlConnection,MySql.Data.MySqlClient.MySqlTransaction)">
<summary>
Initializes a new instance of the <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> class
with the text of the query, a <see cref="T:MySql.Data.MySqlClient.MySqlConnection" />, and the
<see cref="T:MySql.Data.MySqlClient.MySqlTransaction" />.
</summary><param name="cmdText">The text of the query.</param><param name="connection">
A <see cref="T:MySql.Data.MySqlClient.MySqlConnection" /> that represents the
connection to an instance of SQL Server.
</param><param name="transaction">
The <see cref="T:MySql.Data.MySqlClient.MySqlTransaction" /> in which the <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> executes.
</param><remarks>
When an instance of <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> is created,
the following read/write properties are set to initial values.
<list type="table">
<listheader>
<term>Properties</term>
<term>Initial Value</term>
</listheader>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandText" />
</term>
<term>
<i>cmdText</i>
</term>
</item>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandTimeout" />
</term>
<term>0</term>
</item>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandType" />
</term>
<term>CommandType.Text</term>
</item>
<item>
<term>
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.Connection" />
</term>
<term>
<i>connection</i>
</term>
</item>
</list>
<para>
You can change the value for any of these properties through a separate call to
the property.
</para>
</remarks><example>
The following example creates a <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> and
sets some of its properties.
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim conn as new MySqlConnection("server=myServer")
conn.Open();
Dim txn as MySqlTransaction = conn.BeginTransaction()
Dim sql as String = "SELECT * FROM mytable"
Dim myCommand As New MySqlCommand(sql, conn, txn)
myCommand.CommandType = CommandType.Text
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
MySqlConnection conn = new MySqlConnection("server=myserver")
conn.Open();
MySqlTransaction txn = conn.BeginTransaction();
string sql = "SELECT * FROM mytable";
MySqlCommand myCommand = new MySqlCommand(sql, conn, txn);
myCommand.CommandType = CommandType.Text;
}
</code>
</example>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlCommand.LastInsertedId">
<!-- No matching elements were found for the following include tag --><include file="docs/mysqlcommand.xml" path="docs/LastInseredId/*" />
</member>
<member name="P:MySql.Data.MySqlClient.MySqlCommand.CommandText">
<summary>
Gets or sets the SQL statement to execute at the data source.
</summary><value>
The SQL statement or stored procedure to execute. The default is an empty string.
</value><remarks>
<para>
When the <see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandType" /> property is set to <B>StoredProcedure</B>,
the <B>CommandText</B> property should be set to the name of the stored procedure.
The user may be required to use escape character syntax if the stored procedure name
contains any special characters. The command executes this stored procedure when
you call one of the Execute methods. Starting with Connector/Net 5.0, having both a stored function
and stored procedure with the same name in the same database is not supported. It is
suggested that you provide unqiue names for your stored routines.
</para>
</remarks><example>
The following example creates a <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> and sets some of its properties.
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim myCommand As New MySqlCommand()
myCommand.CommandText = "SELECT * FROM Mytable ORDER BY id"
myCommand.CommandType = CommandType.Text
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
MySqlCommand myCommand = new MySqlCommand();
myCommand.CommandText = "SELECT * FROM mytable ORDER BY id";
myCommand.CommandType = CommandType.Text;
}
</code>
</example>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlCommand.CommandTimeout">
<summary>
Gets or sets the wait time before terminating the attempt to execute a command
and generating an error.
</summary><value>
The time (in seconds) to wait for the command to execute. The default is 30
seconds.
</value><remarks>
CommandTimeout is dependent on the ability of MySQL to cancel an executing query.
Because of this, CommandTimeout is only supported when connected to MySQL
version 5.0.0 or higher.
</remarks>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlCommand.CommandType">
<summary>
Gets or sets a value indicating how the <see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandText" /> property is to be interpreted.
</summary><value>
One of the <see cref="T:System.Data.CommandType" /> values. The default is <B>Text</B>.
</value><remarks>
<para>
When you set the <B>CommandType</B> property to <B>StoredProcedure</B>, you
should set the <see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandText" /> property to the name of the stored
procedure. The command executes this stored procedure when you call one of the
Execute methods.
</para>
</remarks><example>
The following example creates a <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> and sets some of its properties.
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim myCommand As New MySqlCommand()
myCommand.CommandType = CommandType.Text
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
MySqlCommand myCommand = new MySqlCommand();
myCommand.CommandType = CommandType.Text;
}
</code>
</example>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlCommand.IsPrepared">
<!-- No matching elements were found for the following include tag --><include file="docs/mysqlcommand.xml" path="docs/IsPrepared/*" />
</member>
<member name="P:MySql.Data.MySqlClient.MySqlCommand.Connection">
<summary>
Gets or sets the <see cref="T:MySql.Data.MySqlClient.MySqlConnection" /> used by this instance of the
<see cref="T:MySql.Data.MySqlClient.MySqlCommand" />.
</summary><value>
The connection to a data source. The default value is a null reference
(<B>Nothing</B> in Visual Basic).
</value><remarks>
<para>
If you set <B>Connection</B> while a transaction is in progress and the
<see cref="P:MySql.Data.MySqlClient.MySqlCommand.Transaction" /> property is not null, an <see cref="T:System.InvalidOperationException" />
is generated. If the <B>Transaction</B> property is not null and the transaction
has already been committed or rolled back, <B>Transaction</B> is set to
null.
</para>
</remarks><example>
The following example creates a <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> and sets some of its properties.
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim mySelectQuery As String = "SELECT * FROM mytable ORDER BY id"
Dim myConnectString As String = "Persist Security Info=False;database=test;server=myServer"
Dim myCommand As New MySqlCommand(mySelectQuery)
myCommand.Connection = New MySqlConnection(myConnectString)
myCommand.CommandType = CommandType.Text
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
string mySelectQuery = "SELECT * FROM mytable ORDER BY id";
string myConnectString = "Persist Security Info=False;database=test;server=myServer";
MySqlCommand myCommand = new MySqlCommand(mySelectQuery);
myCommand.Connection = new MySqlConnection(myConnectString);
myCommand.CommandType = CommandType.Text;
}
</code>
</example>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlCommand.Parameters">
<summary>
Get the <see cref="T:MySql.Data.MySqlClient.MySqlParameterCollection" />
</summary><value>
The parameters of the SQL statement or stored procedure. The default is
an empty collection.
</value><remarks>
Connector/Net does not support unnamed parameters. Every parameter added to the collection must
have an associated name.
</remarks><example>
The following example creates a <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> and displays its parameters.
To accomplish this, the method is passed a <see cref="T:MySql.Data.MySqlClient.MySqlConnection" />, a query string
that is a SQL SELECT statement, and an array of <see cref="T:MySql.Data.MySqlClient.MySqlParameter" /> objects.
<code lang="vbnet">
Public Sub CreateMySqlCommand(myConnection As MySqlConnection, _
mySelectQuery As String, myParamArray() As MySqlParameter)
Dim myCommand As New MySqlCommand(mySelectQuery, myConnection)
myCommand.CommandText = "SELECT id, name FROM mytable WHERE age=@age"
myCommand.UpdatedRowSource = UpdateRowSource.Both
myCommand.Parameters.Add(myParamArray)
Dim j As Integer
For j = 0 To myCommand.Parameters.Count - 1
myCommand.Parameters.Add(myParamArray(j))
Next j
Dim myMessage As String = ""
Dim i As Integer
For i = 0 To myCommand.Parameters.Count - 1
myMessage += myCommand.Parameters(i).ToString() & ControlChars.Cr
Next i
Console.WriteLine(myMessage)
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand(MySqlConnection myConnection, string mySelectQuery,
MySqlParameter[] myParamArray)
{
MySqlCommand myCommand = new MySqlCommand(mySelectQuery, myConnection);
myCommand.CommandText = "SELECT id, name FROM mytable WHERE age=@age";
myCommand.Parameters.Add(myParamArray);
for (int j=0; j<myParamArray.Length; j++)
{
myCommand.Parameters.Add(myParamArray[j]) ;
}
string myMessage = "";
for (int i = 0; i < myCommand.Parameters.Count; i++)
{
myMessage += myCommand.Parameters[i].ToString() + "\n";
}
MessageBox.Show(myMessage);
}
</code>
</example>
</member>
<member name="P:MySql.Data.MySqlClient.MySqlCommand.Transaction">
<summary>
Gets or sets the <see cref="T:MySql.Data.MySqlClient.MySqlTransaction" /> within which the <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> executes.
</summary><value>
The <see cref="T:MySql.Data.MySqlClient.MySqlTransaction" />. The default value is a null reference (<B>Nothing</B> in Visual Basic).
</value><remarks>
You cannot set the <B>Transaction</B> property if it is already set to a
specific value, and the command is in the process of executing. If you set the
transaction property to a <see cref="T:MySql.Data.MySqlClient.MySqlTransaction" /> object that is not connected
to the same <see cref="T:MySql.Data.MySqlClient.MySqlConnection" /> as the <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> object,
an exception will be thrown the next time you attempt to execute a statement.
</remarks>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.Cancel">
<summary>
Attempts to cancel the execution of a currently active command
</summary>
<remarks>
Cancelling a currently active query only works with MySQL versions 5.0.0 and higher.
</remarks>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.CreateParameter">
<summary>
Creates a new instance of a <see cref="T:MySql.Data.MySqlClient.MySqlParameter"/> object.
</summary>
<remarks>
This method is a strongly-typed version of <see cref="M:System.Data.IDbCommand.CreateParameter"/>.
</remarks>
<returns>A <see cref="T:MySql.Data.MySqlClient.MySqlParameter"/> object.</returns>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.CheckState">
<summary>
Check the connection to make sure
- it is open
- it is not currently being used by a reader
- and we have the right version of MySQL for the requested command type
</summary>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery">
<summary>
Executes a SQL statement against the connection and returns the number of rows affected.
</summary><returns>Number of rows affected</returns><remarks>
You can use ExecuteNonQuery to perform any type of database operation,
however any resultsets returned will not be available. Any output parameters
used in calling a stored procedure will be populated with data and can be
retrieved after execution is complete.
For UPDATE, INSERT, and DELETE statements, the return value is the number
of rows affected by the command. For all other types of statements, the return
value is -1.
</remarks><example>
The following example creates a MySqlCommand and then
executes it using ExecuteNonQuery. The example is passed a string that is a
SQL statement (such as UPDATE, INSERT, or DELETE) and a string to use to
connect to the data source.
<code lang="vbnet">
Public Sub CreateMySqlCommand(myExecuteQuery As String, myConnection As MySqlConnection)
Dim myCommand As New MySqlCommand(myExecuteQuery, myConnection)
myCommand.Connection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand(string myExecuteQuery, MySqlConnection myConnection)
{
MySqlCommand myCommand = new MySqlCommand(myExecuteQuery, myConnection);
myCommand.Connection.Open();
myCommand.ExecuteNonQuery();
myConnection.Close();
}
</code>
</example>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.ResetReader">
<summary>
Reset reader to null, to avoid "There is already an open data reader"
on the next ExecuteReader(). Used in error handling scenarios.
</summary>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.ResetSqlSelectLimit">
<summary>
Reset SQL_SELECT_LIMIT that could have been modified by CommandBehavior.
</summary>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.ExecuteReader">
<summary>
Sends the <see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandText" /> to the <see cref="T:MySql.Data.MySqlClient.MySqlConnection">Connection</see>
and builds a <see cref="T:MySql.Data.MySqlClient.MySqlDataReader" />.
</summary><returns>
A <see cref="T:MySql.Data.MySqlClient.MySqlDataReader" /> object.
</returns><remarks>
<para>
When the <see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandType" /> property is set to <B>StoredProcedure</B>,
the <see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandText" /> property should be set to the name of the stored
procedure. The command executes this stored procedure when you call
<B>ExecuteReader</B>.
</para>
<para>
While the <see cref="T:MySql.Data.MySqlClient.MySqlDataReader" /> is in use, the associated
<see cref="T:MySql.Data.MySqlClient.MySqlConnection" /> is busy serving the <B>MySqlDataReader</B>.
While in this state, no other operations can be performed on the
<B>MySqlConnection</B> other than closing it. This is the case until the
<see cref="M:MySql.Data.MySqlClient.MySqlDataReader.Close" /> method of the <B>MySqlDataReader</B> is called.
</para>
</remarks><example>
The following example creates a <see cref="T:MySql.Data.MySqlClient.MySqlCommand" />, then executes it by
passing a string that is a SQL SELECT statement, and a string to use to connect to the
data source.
<code lang="vbnet">
Public Sub CreateMySqlDataReader(mySelectQuery As String, myConnection As MySqlConnection)
Dim myCommand As New MySqlCommand(mySelectQuery, myConnection)
myConnection.Open()
Dim myReader As MySqlDataReader
myReader = myCommand.ExecuteReader()
Try
While myReader.Read()
Console.WriteLine(myReader.GetString(0))
End While
Finally
myReader.Close
myConnection.Close
End Try
End Sub
</code>
<code lang="C#">
public void CreateMySqlDataReader(string mySelectQuery, MySqlConnection myConnection)
{
MySqlCommand myCommand = new MySqlCommand(mySelectQuery, myConnection);
myConnection.Open();
MMySqlDataReader myReader;
myReader = myCommand.ExecuteReader();
try
{
while(myReader.Read())
{
Console.WriteLine(myReader.GetString(0));
}
}
finally
{
myReader.Close();
myConnection.Close();
}
}
</code>
</example>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(System.Data.CommandBehavior)">
<summary>
Sends the <see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandText" /> to the <see cref="T:MySql.Data.MySqlClient.MySqlConnection">Connection</see>,
and builds a <see cref="T:MySql.Data.MySqlClient.MySqlDataReader" /> using one of the <see cref="T:System.Data.CommandBehavior" /> values.
</summary><param name="behavior">
One of the <see cref="T:System.Data.CommandBehavior" /> values.
</param><remarks>
<para>
When the <see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandType" /> property is set to <B>StoredProcedure</B>,
the <see cref="P:MySql.Data.MySqlClient.MySqlCommand.CommandText" /> property should be set to the name of the stored
procedure. The command executes this stored procedure when you call
<B>ExecuteReader</B>.
</para>
<para>
The <see cref="T:MySql.Data.MySqlClient.MySqlDataReader" /> supports a special mode that enables large binary
values to be read efficiently. For more information, see the <B>SequentialAccess</B>
setting for <see cref="T:System.Data.CommandBehavior" />.
</para>
<para>
While the <see cref="T:MySql.Data.MySqlClient.MySqlDataReader" /> is in use, the associated
<see cref="T:MySql.Data.MySqlClient.MySqlConnection" /> is busy serving the <B>MySqlDataReader</B>.
While in this state, no other operations can be performed on the
<B>MySqlConnection</B> other than closing it. This is the case until the
<see cref="M:MySql.Data.MySqlClient.MySqlDataReader.Close" /> method of the <B>MySqlDataReader</B> is called.
If the <B>MySqlDataReader</B> is created with <B>CommandBehavior</B> set to
<B>CloseConnection</B>, closing the <B>MySqlDataReader</B> closes the connection
automatically.
</para>
<note>
When calling ExecuteReader with the SingleRow behavior, you should be aware that using a <i>limit</i>
clause in your SQL will cause all rows (up to the limit given) to be retrieved by the client. The
<see cref="M:MySql.Data.MySqlClient.MySqlDataReader.Read" /> method will still return false after the first row but pulling all rows of data
into the client will have a performance impact. If the <i>limit</i> clause is not necessary, it should
be avoided.
</note>
</remarks><returns>
A <see cref="T:MySql.Data.MySqlClient.MySqlDataReader" /> object.
</returns>
</member>
<member name="M:MySql.Data.MySqlClient.MySqlCommand.ExecuteScalar">
<summary>
Executes the query, and returns the first column of the first row in the
result set returned by the query. Extra columns or rows are ignored.
</summary><returns>
The first column of the first row in the result set, or a null reference if the
result set is empty
</returns><remarks>
<para>
Use the <B>ExecuteScalar</B> method to retrieve a single value (for example,
an aggregate value) from a database. This requires less code than using the
<see cref="M:MySql.Data.MySqlClient.MySqlCommand.ExecuteReader" /> method, and then performing the operations necessary
to generate the single value using the data returned by a <see cref="T:MySql.Data.MySqlClient.MySqlDataReader" />
</para>
</remarks><example>
The following example creates a <see cref="T:MySql.Data.MySqlClient.MySqlCommand" /> and then
executes it using <B>ExecuteScalar</B>. The example is passed a string that is a
SQL statement that returns an aggregate result, and a string to use to
connect to the data source.
<code lang="vbnet">
Public Sub CreateMySqlCommand(myScalarQuery As String, myConnection As MySqlConnection)
Dim myCommand As New MySqlCommand(myScalarQuery, myConnection)
myCommand.Connection.Open()
myCommand.ExecuteScalar()
myConnection.Close()
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand(string myScalarQuery, MySqlConnection myConnection)
{
MySqlCommand myCommand = new MySqlCommand(myScalarQuery, myConnection);
myCommand.Connection.Open();
myCommand.ExecuteScalar();
myConnection.Close();
}
</code>
<code lang="C++">
public:
void CreateMySqlCommand(String* myScalarQuery, MySqlConnection* myConnection)
{