dataTableSchema.Columns.Add ("BaseTableName", typeof (string));
dataTableSchema.Columns.Add ("DataType", typeof(string));
dataTableSchema.Columns.Add ("AllowDBNull", typeof (bool));
- dataTableSchema.Columns.Add ("ProviderType", typeof (string));
+ dataTableSchema.Columns.Add ("ProviderType", typeof (int));
dataTableSchema.Columns.Add ("IsAliased", typeof (bool));
dataTableSchema.Columns.Add ("IsExpression", typeof (bool));
dataTableSchema.Columns.Add ("IsIdentity", typeof (bool));
schemaRow["DataType"] = st;\r
schemaRow["AllowDBNull"] = false; // ? tim
- schemaRow["ProviderType"] = ""; // ? tim
+ schemaRow["ProviderType"] = oid; // ? tim
schemaRow["IsAliased"] = false; // ? tim
schemaRow["IsExpression"] = false; // ? tim
schemaRow["IsIdentity"] = false; // ? tim
private int rows;
private int cols;
+ private int recordsAffected = -1; // TODO: get this value
+
private int currentRow = -1; // no Read() has been done yet
#endregion // Fields
[MonoTODO]
public Type GetFieldType(int i) {
- return table.Columns[i].DataType;
+ DataRow row = table.Rows[i];
+ return Type.GetType((string)row["DataType"]);
}
[MonoTODO]
[MonoTODO]
public string GetName(int i) {
- return table.Columns[i].ColumnName;
+
+ DataRow row = table.Rows[i];
+ return (string) row["ColumnName"];
}
[MonoTODO]
public int GetOrdinal(string name) {
+
int i;
- for(i = 0; i < cols; i ++) {
- if(table.Columns[i].ColumnName.Equals(name)) {
- return i;
- }
+ DataRow row;
+ for(i = 0; i < table.Rows.Count; i++) {
+ row = table.Rows[i];
+ if(((string) row["ColumnName"]).Equals(name))
+ return i;
}
-
- for(i = 0; i < cols; i++) {
+
+ for(i = 0; i < table.Rows.Count; i++) {
string ta;
string n;
-
- ta = table.Columns[i].ColumnName.ToUpper();
+
+ row = table.Rows[i];
+ ta = ((string) row["ColumnName"]).ToUpper();
n = name.ToUpper();
if(ta.Equals(n)) {
public void Dispose () {
}
- [MonoTODO]
- ~SqlDataReader() {
- }
+ //[MonoTODO]
+ //~SqlDataReader() {
+ //}
#endregion // Destructors
public int Depth {
[MonoTODO]
get {
- throw new NotImplementedException ();
+ return 0; // always return zero, unless
+ // this provider will allow
+ // nesting of a row
}
}
public int RecordsAffected {
[MonoTODO]
get {
- throw new NotImplementedException ();
+ return recordsAffected;
}
}
[MonoTODO]
get {
int i;
- for(i = 0; i < cols; i ++) {
- if(table.Columns[i].ColumnName.Equals(name)) {
- return fields[i];
- }
+ DataRow row;
+ for(i = 0; i < table.Rows.Count; i++) {
+ row = table.Rows[i];
+ if(row["ColumnName"].Equals(name))
+ return fields[i];
}
-
- for(i = 0; i < cols; i++) {
+
+ for(i = 0; i < table.Rows.Count; i++) {
string ta;
string n;
-
- ta = table.Columns[i].ColumnName.ToUpper();
+
+ row = table.Rows[i];
+ ta = ((string) row["ColumnName"]).ToUpper();
n = name.ToUpper();
if(ta.Equals(n)) {
dataTableSchema.Columns.Add ("BaseTableName", typeof (string));
dataTableSchema.Columns.Add ("DataType", typeof(string));
dataTableSchema.Columns.Add ("AllowDBNull", typeof (bool));
- dataTableSchema.Columns.Add ("ProviderType", typeof (string));
+ dataTableSchema.Columns.Add ("ProviderType", typeof (int));
dataTableSchema.Columns.Add ("IsAliased", typeof (bool));
dataTableSchema.Columns.Add ("IsExpression", typeof (bool));
dataTableSchema.Columns.Add ("IsIdentity", typeof (bool));
schemaRow["DataType"] = st;\r
schemaRow["AllowDBNull"] = false; // ? tim
- schemaRow["ProviderType"] = ""; // ? tim
+ schemaRow["ProviderType"] = oid; // ? tim
schemaRow["IsAliased"] = false; // ? tim
schemaRow["IsExpression"] = false; // ? tim
schemaRow["IsIdentity"] = false; // ? tim
private int rows;
private int cols;
+ private int recordsAffected = -1; // TODO: get this value
+
private int currentRow = -1; // no Read() has been done yet
#endregion // Fields
[MonoTODO]
public Type GetFieldType(int i) {
- return table.Columns[i].DataType;
+ DataRow row = table.Rows[i];
+ return Type.GetType((string)row["DataType"]);
}
[MonoTODO]
[MonoTODO]
public string GetName(int i) {
- return table.Columns[i].ColumnName;
+
+ DataRow row = table.Rows[i];
+ return (string) row["ColumnName"];
}
[MonoTODO]
public int GetOrdinal(string name) {
+
int i;
- for(i = 0; i < cols; i ++) {
- if(table.Columns[i].ColumnName.Equals(name)) {
- return i;
- }
+ DataRow row;
+ for(i = 0; i < table.Rows.Count; i++) {
+ row = table.Rows[i];
+ if(((string) row["ColumnName"]).Equals(name))
+ return i;
}
-
- for(i = 0; i < cols; i++) {
+
+ for(i = 0; i < table.Rows.Count; i++) {
string ta;
string n;
-
- ta = table.Columns[i].ColumnName.ToUpper();
+
+ row = table.Rows[i];
+ ta = ((string) row["ColumnName"]).ToUpper();
n = name.ToUpper();
if(ta.Equals(n)) {
public void Dispose () {
}
- [MonoTODO]
- ~SqlDataReader() {
- }
+ //[MonoTODO]
+ //~SqlDataReader() {
+ //}
#endregion // Destructors
public int Depth {
[MonoTODO]
get {
- throw new NotImplementedException ();
+ return 0; // always return zero, unless
+ // this provider will allow
+ // nesting of a row
}
}
public int RecordsAffected {
[MonoTODO]
get {
- throw new NotImplementedException ();
+ return recordsAffected;
}
}
[MonoTODO]
get {
int i;
- for(i = 0; i < cols; i ++) {
- if(table.Columns[i].ColumnName.Equals(name)) {
- return fields[i];
- }
+ DataRow row;
+ for(i = 0; i < table.Rows.Count; i++) {
+ row = table.Rows[i];
+ if(row["ColumnName"].Equals(name))
+ return fields[i];
}
-
- for(i = 0; i < cols; i++) {
+
+ for(i = 0; i < table.Rows.Count; i++) {
string ta;
string n;
-
- ta = table.Columns[i].ColumnName.ToUpper();
+
+ row = table.Rows[i];
+ ta = ((string) row["ColumnName"]).ToUpper();
n = name.ToUpper();
if(ta.Equals(n)) {
+2002-05-23 Daniel Morgan <danmorg@sc.rr.com>
+
+ * System.Data.SqlClient/SqlCommand.cs: set
+ the "ProviderType" to the PostgreSQL type oid
+
+ * System.Data.SqlClient/SqlDataReader.cs: fix
+ for various properties and methods that
+ return meta data: Item indexers this[name] and this[index],
+ GetFieldType, GetName, and GetOrdinal. SqlDataAdapter
+ should work again.
+
2002-05-22 Daniel Morgan <danmorg@sc.rr.com>
* System.Data/DataRow.cs: change suggested
dataTableSchema.Columns.Add ("BaseTableName", typeof (string));
dataTableSchema.Columns.Add ("DataType", typeof(string));
dataTableSchema.Columns.Add ("AllowDBNull", typeof (bool));
- dataTableSchema.Columns.Add ("ProviderType", typeof (string));
+ dataTableSchema.Columns.Add ("ProviderType", typeof (int));
dataTableSchema.Columns.Add ("IsAliased", typeof (bool));
dataTableSchema.Columns.Add ("IsExpression", typeof (bool));
dataTableSchema.Columns.Add ("IsIdentity", typeof (bool));
schemaRow["DataType"] = st;\r
schemaRow["AllowDBNull"] = false; // ? tim
- schemaRow["ProviderType"] = ""; // ? tim
+ schemaRow["ProviderType"] = oid; // ? tim
schemaRow["IsAliased"] = false; // ? tim
schemaRow["IsExpression"] = false; // ? tim
schemaRow["IsIdentity"] = false; // ? tim
private int rows;
private int cols;
+ private int recordsAffected = -1; // TODO: get this value
+
private int currentRow = -1; // no Read() has been done yet
#endregion // Fields
[MonoTODO]
public Type GetFieldType(int i) {
- return table.Columns[i].DataType;
+ DataRow row = table.Rows[i];
+ return Type.GetType((string)row["DataType"]);
}
[MonoTODO]
[MonoTODO]
public string GetName(int i) {
- return table.Columns[i].ColumnName;
+
+ DataRow row = table.Rows[i];
+ return (string) row["ColumnName"];
}
[MonoTODO]
public int GetOrdinal(string name) {
+
int i;
- for(i = 0; i < cols; i ++) {
- if(table.Columns[i].ColumnName.Equals(name)) {
- return i;
- }
+ DataRow row;
+ for(i = 0; i < table.Rows.Count; i++) {
+ row = table.Rows[i];
+ if(((string) row["ColumnName"]).Equals(name))
+ return i;
}
-
- for(i = 0; i < cols; i++) {
+
+ for(i = 0; i < table.Rows.Count; i++) {
string ta;
string n;
-
- ta = table.Columns[i].ColumnName.ToUpper();
+
+ row = table.Rows[i];
+ ta = ((string) row["ColumnName"]).ToUpper();
n = name.ToUpper();
if(ta.Equals(n)) {
public void Dispose () {
}
- [MonoTODO]
- ~SqlDataReader() {
- }
+ //[MonoTODO]
+ //~SqlDataReader() {
+ //}
#endregion // Destructors
public int Depth {
[MonoTODO]
get {
- throw new NotImplementedException ();
+ return 0; // always return zero, unless
+ // this provider will allow
+ // nesting of a row
}
}
public int RecordsAffected {
[MonoTODO]
get {
- throw new NotImplementedException ();
+ return recordsAffected;
}
}
[MonoTODO]
get {
int i;
- for(i = 0; i < cols; i ++) {
- if(table.Columns[i].ColumnName.Equals(name)) {
- return fields[i];
- }
+ DataRow row;
+ for(i = 0; i < table.Rows.Count; i++) {
+ row = table.Rows[i];
+ if(row["ColumnName"].Equals(name))
+ return fields[i];
}
-
- for(i = 0; i < cols; i++) {
+
+ for(i = 0; i < table.Rows.Count; i++) {
string ta;
string n;
-
- ta = table.Columns[i].ColumnName.ToUpper();
+
+ row = table.Rows[i];
+ ta = ((string) row["ColumnName"]).ToUpper();
n = name.ToUpper();
if(ta.Equals(n)) {