2002-10-19 Tim Coleman (tim@timcoleman.com)
[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                 string commandText;
21                 int commandTimeout;
22                 CommandType commandType;
23                 TdsConnection connection;
24                 TdsParameterCollection parameters;
25                 TdsTransaction transaction;
26
27                 #endregion // Fields
28
29                 #region Constructors
30
31                 public TdsCommand ()
32                 {
33                 }
34
35                 #endregion // Constructors
36
37                 #region Properties
38
39                 public string CommandText {
40                         get { return commandText; }
41                         set { commandText = value; }
42                 }
43
44                 public int CommandTimeout {
45                         get { return commandTimeout; }
46                         set { commandTimeout = value; }
47                 }
48
49                 public CommandType CommandType {
50                         get { return commandType; }
51                         set { commandType = value; }
52                 }
53
54                 public TdsConnection Connection {       
55                         get { return connection; }
56                         set { connection = value; }
57                 }
58
59                 IDbConnection IDbCommand.Connection {
60                         get { return Connection; }
61                         set { 
62                                 if (!(value is TdsConnection)) 
63                                         throw new ArgumentException ();
64                                 Connection = (TdsConnection) value;     
65                         }
66                 }
67
68                 IDataParameterCollection IDbCommand.Parameters {
69                         get { return Parameters; }
70                 }
71
72                 IDbTransaction IDbCommand.Transaction {
73                         get { return Transaction; }
74                         set { 
75                                 if (!(value is TdsTransaction)) 
76                                         throw new ArgumentException ();
77                                 Transaction = (TdsTransaction) value; 
78                         }
79                 }
80
81                 public TdsParameterCollection Parameters {
82                         get { return parameters; }
83                 }
84
85                 public TdsTransaction Transaction {
86                         get { return transaction; }
87                         set { transaction = value; }
88                 }
89
90                 [System.MonoTODO]
91                 public UpdateRowSource UpdatedRowSource {
92                         get { throw new NotImplementedException (); }
93                         set { throw new NotImplementedException (); }
94                 }
95
96                 #endregion // Properties
97
98                 #region Methods
99
100                 [System.MonoTODO]
101                 public void Cancel ()
102                 {
103                         throw new NotImplementedException ();
104                 }
105
106                 [System.MonoTODO]
107                 TdsParameter CreateParameter ()
108                 {
109                         throw new NotImplementedException ();
110                 }
111
112                 [System.MonoTODO]
113                 public int ExecuteNonQuery ()
114                 {
115                         throw new NotImplementedException ();
116                 }
117
118                 public TdsDataReader ExecuteReader ()
119                 {
120                         return ExecuteReader (CommandBehavior.Default);
121                 }
122
123                 [System.MonoTODO]
124                 public TdsDataReader ExecuteReader (CommandBehavior behavior)
125                 {
126                         throw new NotImplementedException ();
127                 }
128
129                 [System.MonoTODO]
130                 public object ExecuteScalar ()
131                 {
132                         throw new NotImplementedException ();
133                 }
134
135                 [System.MonoTODO]
136                 object ICloneable.Clone()
137                 {
138                         throw new NotImplementedException ();
139                 }
140
141                 IDbDataParameter IDbCommand.CreateParameter ()
142                 {
143                         return CreateParameter ();
144                 }
145
146                 IDataReader IDbCommand.ExecuteReader ()
147                 {
148                         return ExecuteReader ();
149                 }
150
151                 IDataReader IDbCommand.ExecuteReader (CommandBehavior behavior)
152                 {
153                         return ExecuteReader (behavior);
154                 }
155
156                 [System.MonoTODO]
157                 public void Prepare ()
158                 {
159                         throw new NotImplementedException ();
160                 }
161
162                 /*
163                 internal void SkipToEnd ()
164                 {
165                         if (tds != null)
166                                 while (GetMoreResults (tds, false) || updateCount != 1);
167                 }
168                 */
169
170                 #endregion // Methods
171         }
172 }