*** empty log message ***
[mono.git] / mcs / class / Mono.Data.TdsClient / Mono.Data.TdsClient / TdsCommand.cs
1 //
2 // Mono.Data.TdsClient.TdsCommand.cs
3 //
4 // Author:
5 //   Tim Coleman (tim@timcoleman.com)
6 //
7 // Copyright (C) 2002 Tim Coleman
8 //
9
10 using Mono.Data.TdsClient.Internal;
11 using System;
12 using System.ComponentModel;
13 using System.Data;
14
15 namespace Mono.Data.TdsClient {
16         public class TdsCommand : Component, ICloneable, IDbCommand
17         {
18                 #region Fields
19
20                 internal TdsCommandInternal command;
21
22                 #endregion // Fields
23
24                 #region Constructors
25
26                 public TdsCommand ()
27                 {
28                         command = new TdsCommandInternal ();
29                 }
30
31                 #endregion // Constructors
32
33                 #region Properties
34
35                 public string CommandText {
36                         get { return command.CommandText; }
37                         set { command.CommandText = value; }
38                 }
39
40                 public int CommandTimeout {
41                         get { return command.CommandTimeout; }
42                         set { command.CommandTimeout = value; }
43                 }
44
45                 public CommandType CommandType {
46                         get { return command.CommandType; }
47                         set { command.CommandType = value; }
48                 }
49
50                 IDbConnection IDbCommand.Connection {
51                         get { return ((IDbCommand) command).Connection; }
52                         set { ((IDbCommand) command).Connection = value; }
53                 }
54
55                 IDataParameterCollection IDbCommand.Parameters {
56                         get { return ((IDbCommand) command).Parameters; }
57                 }
58
59                 IDbTransaction IDbCommand.Transaction {
60                         get { return ((IDbCommand) command).Transaction; }
61                         set { ((IDbCommand) command).Transaction = value; }
62                 }
63
64                 public UpdateRowSource UpdatedRowSource {
65                         get { return command.UpdatedRowSource; }
66                         set { command.UpdatedRowSource = value; }
67                 }
68
69                 #endregion // Properties
70
71                 #region Methods
72
73                 public void Cancel ()
74                 {
75                         command.Cancel ();
76                 }
77
78                 IDbDataParameter IDbCommand.CreateParameter ()
79                 {
80                         return ((IDbCommand) command).CreateParameter ();
81                 }
82
83                 public int ExecuteNonQuery ()
84                 {
85                         return command.ExecuteNonQuery ();
86                 }
87
88                 IDataReader IDbCommand.ExecuteReader ()
89                 {
90                         return ((IDbCommand) command).ExecuteReader ();
91                 }
92
93                 IDataReader IDbCommand.ExecuteReader (CommandBehavior behavior)
94                 {
95                         return ((IDbCommand) command).ExecuteReader (behavior);
96                 }
97
98                 public object ExecuteScalar ()
99                 {
100                         return command.ExecuteScalar ();
101                 }
102
103                 [System.MonoTODO]
104                 object ICloneable.Clone()
105                 {
106                         throw new NotImplementedException ();
107                 }
108
109                 public void Prepare ()
110                 {
111                         command.Prepare ();
112                 }
113
114                 #endregion // Methods
115         }
116 }