protected override void PopulateVersionAndTypes() { base._sqlVersion = "10"; List <KeyValuePair <int, byte> > list = new List <KeyValuePair <int, byte> >(); using (SqlDataReader reader = new SqlCommand("select system_type_id, user_type_id, name from sys.types where system_type_id = user_type_id", base._cx).ExecuteReader()) { while (reader.Read()) { DbTypeInfo dbTypeInfo = SqlSchemaReader.GetDbTypeInfo(reader.GetString(2)); if (!((dbTypeInfo == null) || base._sqlTypes.ContainsKey(reader.GetInt32(1)))) { base._sqlTypes.Add(reader.GetInt32(1), dbTypeInfo); } else { list.Add(new KeyValuePair <int, byte>(reader.GetInt32(1), reader.GetByte(0))); } } } foreach (KeyValuePair <int, byte> pair in list) { if (base._sqlTypes.ContainsKey(pair.Value)) { base._sqlTypes[pair.Key] = base._sqlTypes[pair.Value]; } } }
protected virtual void PopulateVersionAndTypes() { string cmdText = "select SERVERPROPERTY('productversion')\r\nselect xtype, xusertype, name from " + this._serverPrefix + "dbo.systypes"; List <KeyValuePair <short, byte> > list = new List <KeyValuePair <short, byte> >(); using (SqlDataReader reader = new SqlCommand(cmdText, this._cx).ExecuteReader()) { reader.Read(); this._sqlVersion = reader.GetString(0); if (reader.NextResult()) { while (reader.Read()) { DbTypeInfo dbTypeInfo = SqlSchemaReader.GetDbTypeInfo(reader.GetString(2)); if (!((dbTypeInfo == null) || this._sqlTypes.ContainsKey(reader.GetInt16(1)))) { this._sqlTypes.Add(reader.GetInt16(1), dbTypeInfo); } else { list.Add(new KeyValuePair <short, byte>(reader.GetInt16(1), reader.GetByte(0))); } } } } foreach (KeyValuePair <short, byte> pair in list) { if (this._sqlTypes.ContainsKey(pair.Value)) { this._sqlTypes[pair.Key] = this._sqlTypes[pair.Value]; } } }