2 // System.Data.Sql.SqlMetaData
5 // Tim Coleman (tim@timcoleman.com)
7 // Copyright (C) Tim Coleman, 2003
11 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 using System
.Data
.SqlTypes
;
38 namespace System
.Data
.Sql
{
39 public sealed class SqlMetaData
43 public const long x_lMax
= -1;
45 SqlCompareOptions compareOptions
= SqlCompareOptions
.None
;
46 string databaseName
= null;
47 bool isPartialLength
= false;
53 string schemaName
= null;
54 SqlDbType sqlDbType
= SqlDbType
.Int
;
61 public SqlMetaData (string name
, SqlDbType type
)
64 this.sqlDbType
= type
;
68 public SqlMetaData (string name
, SqlDbType type
, long maxLength
)
70 this.maxLength
= maxLength
;
72 this.sqlDbType
= type
;
76 public SqlMetaData (string name
, SqlDbType type
, SqlMetaData
[] columnMetaData
)
78 this.sqlDbType
= type
;
82 public SqlMetaData (string name
, SqlDbType type
, byte precision
, byte scale
)
85 this.precision
= precision
;
87 this.sqlDbType
= type
;
91 public SqlMetaData (string strName
, long maxLength
, long localeId
, SqlCompareOptions compareOptions
, string udtTypeName
)
93 this.compareOptions
= compareOptions
;
94 this.localeId
= localeId
;
95 this.maxLength
= maxLength
;
100 public SqlMetaData (string name
, SqlDbType type
, long maxLength
, long locale
, SqlCompareOptions compareOptions
)
102 this.compareOptions
= compareOptions
;
103 this.localeId
= locale
;
104 this.maxLength
= maxLength
;
106 this.sqlDbType
= type
;
110 public SqlMetaData (string name
, SqlDbType type
, long maxLength
, byte precision
, byte scale
, long localeId
, SqlCompareOptions compareOptions
, string DatabaseName
, string SchemaName
, bool PartialLength
, string udtTypeName
)
112 this.compareOptions
= compareOptions
;
113 this.databaseName
= DatabaseName
;
114 this.isPartialLength
= PartialLength
;
115 this.localeId
= localeId
;
116 this.maxLength
= maxLength
;
118 this.precision
= precision
;
120 this.schemaName
= SchemaName
;
121 this.sqlDbType
= type
;
124 #endregion // Constructors
128 public SqlCompareOptions CompareOptions
{
129 get { return compareOptions; }
132 public string DatabaseName
{
133 get { return databaseName; }
137 public DbType DbType
{
138 get { throw new NotImplementedException (); }
141 public bool IsPartialLength
{
142 get { return isPartialLength; }
145 public long LocaleId
{
146 get { return localeId; }
149 public static long MAX
{
150 get { return x_lMax; }
153 public long MaxLength
{
154 get { return maxLength; }
161 public byte Precision
{
162 get { return precision; }
166 get { return scale; }
169 public string SchemaName
{
170 get { return schemaName; }
173 public SqlDbType SqlDbType
{
174 get { return sqlDbType; }
178 public string TypeName
{
179 get { throw new NotImplementedException (); }
182 #endregion // Properties
187 public bool Adjust (bool value)
189 throw new NotImplementedException ();
193 public byte Adjust (byte value)
195 throw new NotImplementedException ();
199 public byte[] Adjust (byte[] value)
201 throw new NotImplementedException ();
205 public char Adjust (char value)
207 throw new NotImplementedException ();
211 public char[] Adjust (char[] value)
213 throw new NotImplementedException ();
217 public DateTime
Adjust (DateTime
value)
219 throw new NotImplementedException ();
223 public decimal Adjust (decimal value)
225 throw new NotImplementedException ();
229 public double Adjust (double value)
231 throw new NotImplementedException ();
235 public Guid
Adjust (Guid
value)
237 throw new NotImplementedException ();
241 public short Adjust (short value)
243 throw new NotImplementedException ();
247 public int Adjust (int value)
249 throw new NotImplementedException ();
253 public long Adjust (long value)
255 throw new NotImplementedException ();
259 public object Adjust (object value)
261 throw new NotImplementedException ();
265 public float Adjust (float value)
267 throw new NotImplementedException ();
271 public SqlBinary
Adjust (SqlBinary
value)
273 throw new NotImplementedException ();
277 public SqlBoolean
Adjust (SqlBoolean
value)
279 throw new NotImplementedException ();
283 public SqlByte
Adjust (SqlByte
value)
285 throw new NotImplementedException ();
289 public SqlBytes
Adjust (SqlBytes
value)
291 throw new NotImplementedException ();
295 public SqlChars
Adjust (SqlChars
value)
297 throw new NotImplementedException ();
301 public SqlDateTime
Adjust (SqlDateTime
value)
303 throw new NotImplementedException ();
307 public SqlDecimal
Adjust (SqlDecimal
value)
309 throw new NotImplementedException ();
313 public SqlDouble
Adjust (SqlDouble
value)
315 throw new NotImplementedException ();
319 public SqlGuid
Adjust (SqlGuid
value)
321 throw new NotImplementedException ();
325 public SqlInt16
Adjust (SqlInt16
value)
327 throw new NotImplementedException ();
331 public SqlInt32
Adjust (SqlInt32
value)
333 throw new NotImplementedException ();
337 public SqlInt64
Adjust (SqlInt64
value)
339 throw new NotImplementedException ();
343 public SqlMoney
Adjust (SqlMoney
value)
345 throw new NotImplementedException ();
349 public SqlSingle
Adjust (SqlSingle
value)
351 throw new NotImplementedException ();
355 public SqlString
Adjust (SqlString
value)
357 throw new NotImplementedException ();
361 public string Adjust (string value)
363 throw new NotImplementedException ();
367 public SqlMetaData
GetMetaData (int i
)
369 throw new NotImplementedException ();
373 public static SqlMetaData
InferFromValue (object value, string name
)
375 throw new NotImplementedException ();
378 #endregion // Methods