diff --git a/src/System.Data.Common/src/System/Data/DataColumnCollection.cs b/src/System.Data.Common/src/System/Data/DataColumnCollection.cs index 7598e2c59869..014ad8b400b0 100644 --- a/src/System.Data.Common/src/System/Data/DataColumnCollection.cs +++ b/src/System.Data.Common/src/System/Data/DataColumnCollection.cs @@ -802,11 +802,6 @@ private void OnCollectionChanged(CollectionChangeEventArgs ccevent) { _table.UpdatePropertyDescriptorCollectionCache(); - if ((null != ccevent) && !_table.SchemaLoading && !_table.fInitInProgress) - { - DataColumn column = (DataColumn)ccevent.Element; - } - CollectionChanged?.Invoke(this, ccevent); } diff --git a/src/System.Data.Common/src/System/Data/XMLSchema.cs b/src/System.Data.Common/src/System/Data/XMLSchema.cs index e88572c8f1f0..726c377f61e1 100644 --- a/src/System.Data.Common/src/System/Data/XMLSchema.cs +++ b/src/System.Data.Common/src/System/Data/XMLSchema.cs @@ -783,7 +783,8 @@ public void LoadSchema(XmlSchemaSet schemaSet, DataSet ds) continue; } - DataTable table = HandleTable(element); + _ = HandleTable(element); + } if (_dsElement != null) @@ -2364,7 +2365,6 @@ internal void HandleElementColumn(XmlSchemaElement elem, DataTable table, bool i // it should be user defined Named simple type if (((XmlSchemaSimpleType)typeNode).Name != null && ((XmlSchemaSimpleType)typeNode).Name.Length != 0 && ((XmlSchemaSimpleType)typeNode).QualifiedName.Namespace != Keywords.XSDNS) { - string targetNamespace = XSDSchema.GetMsdataAttribute(typeNode, Keywords.TARGETNAMESPACE); strType = ((XmlSchemaSimpleType)typeNode).QualifiedName.ToString(); // use qualifed name type = ParseDataType(strType); } @@ -2536,7 +2536,6 @@ internal void HandleDataSet(XmlSchemaElement node, bool isNewDataSet) { string dsName = node.Name; string dsNamespace = node.QualifiedName.Namespace; - int initialTableCount = _ds.Tables.Count; // just use for inference backward compatablity List tableSequenceList = new List(); diff --git a/src/System.Data.Common/src/System/Data/xmlsaver.cs b/src/System.Data.Common/src/System/Data/xmlsaver.cs index 59c86728cfe4..c8cee2a4d2c2 100644 --- a/src/System.Data.Common/src/System/Data/xmlsaver.cs +++ b/src/System.Data.Common/src/System/Data/xmlsaver.cs @@ -949,7 +949,7 @@ internal XmlElement SchemaTree(XmlDocument xd, DataTable dt) _sRoot = rootSchema; WriteSchemaRoot(xd, rootSchema, dt.Namespace); - XmlElement dsCompositor = FillDataSetElement(xd, null, dt); + _ = FillDataSetElement(xd, null, dt); _constraintSeparator = xd.CreateElement(Keywords.XSD_PREFIX, "SHOULDNOTBEHERE", Keywords.XSDNS); _dsElement.AppendChild(_constraintSeparator); @@ -1493,8 +1493,7 @@ internal XmlElement HandleColumn(DataColumn col, XmlDocument dc, XmlElement sche root.SetAttribute(Keywords.REF, _prefixes[col.Namespace] + ":" + col.EncodedColumnName); if (col.Table.Namespace != _ds.Namespace) { - string prefix = (string)_prefixes[col.Namespace]; - XmlElement tNode = GetSchema(col.Table.Namespace); + _ = GetSchema(col.Table.Namespace); } } } @@ -2486,9 +2485,6 @@ private void GenerateRow(DataRow row) string tablePrefix = (table.Namespace.Length != 0) ? table.Prefix : string.Empty; - // read value if the TextOnly column (if any) - object val = (table.XmlText == null ? DBNull.Value : row[table.XmlText, DataRowVersion.Original]); - //old row _xmlw.WriteStartElement(tablePrefix, row.Table.EncodedTableName, row.Table.Namespace); @@ -2774,8 +2770,6 @@ internal void SaveDiffgramData(XmlWriter xw, Hashtable rowsOrder) _isDiffgram = true; _rowsOrder = rowsOrder; - int countTopTable = _topLevelTables.Length; - string prefix = (_ds != null) ? ((_ds.Namespace.Length == 0) ? "" : _ds.Prefix) : ((_dt.Namespace.Length == 0) ? "" : _dt.Prefix); if (_ds == null || _ds.DataSetName == null || _ds.DataSetName.Length == 0)