Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorDaniel Morgan <monodanmorg@yahoo.com>2003-03-17 20:35:06 +0300
committerDaniel Morgan <monodanmorg@yahoo.com>2003-03-17 20:35:06 +0300
commit468d31eee076f73731066e5210424b7d89cfdcf4 (patch)
tree3c5dba12c7f0117093aad34065569b2f0d9ed109 /mcs
parentd0fb82eaa0a9ba6105bb10102e727054cb3bfddf (diff)
2003-03-17 Daniel Morgan <danmorg@sc.rr.com>
* System.Data.build: on windows build, ignore warnings CS0219: "The variable xxx is assigned but its value is never used" and CS0168: "The variable xxx is declared but never used" * System.Data/DataRow.cs: flush * System.Data/DataSet.cs: start implementation on Clear(), and WriteXml() should write the start element <?xml ... ?> at the top of the document * System.Data/DataTable.cs: TODO/FIXME notes. Start implementation of Compute() - still not working svn path=/trunk/mcs/; revision=12626
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/System.Data/ChangeLog16
-rw-r--r--mcs/class/System.Data/System.Data.build2
-rw-r--r--mcs/class/System.Data/System.Data/DataRow.cs4
-rw-r--r--mcs/class/System.Data/System.Data/DataSet.cs9
-rw-r--r--mcs/class/System.Data/System.Data/DataTable.cs31
5 files changed, 56 insertions, 6 deletions
diff --git a/mcs/class/System.Data/ChangeLog b/mcs/class/System.Data/ChangeLog
index aabfb3b2476..7b977966150 100644
--- a/mcs/class/System.Data/ChangeLog
+++ b/mcs/class/System.Data/ChangeLog
@@ -1,3 +1,19 @@
+2003-03-17 Daniel Morgan <danmorg@sc.rr.com>
+
+ * System.Data.build: on windows build, ignore
+ warnings CS0219: "The variable xxx is assigned but its value is
+ never used" and CS0168: "The variable xxx
+ is declared but never used"
+
+ * System.Data/DataRow.cs: flush
+
+ * System.Data/DataSet.cs: start implementation on Clear(),
+ and WriteXml() should write the start element <?xml ... ?> at the top
+ of the document
+
+ * System.Data/DataTable.cs: TODO/FIXME notes. Start implementation
+ of Compute() - still not working
+
2003-03-16 Daniel Morgan <danmorg@sc.rr.com>
* System.Data/DataRowView.cs: in the constructor pass
diff --git a/mcs/class/System.Data/System.Data.build b/mcs/class/System.Data/System.Data.build
index fa4b40bdf5f..2723f8909cc 100644
--- a/mcs/class/System.Data/System.Data.build
+++ b/mcs/class/System.Data/System.Data.build
@@ -13,6 +13,8 @@
<arg value="/nowarn:0169"/>
<arg value="/nowarn:0679"/>
<arg value="/nowarn:0649"/>
+ <arg value="/nowarn:0219"/>
+ <arg value="/nowarn:0168"/>
<arg value="/unsafe"/>
<arg value="/noconfig"/>
<arg value="/r:System.dll"/>
diff --git a/mcs/class/System.Data/System.Data/DataRow.cs b/mcs/class/System.Data/System.Data/DataRow.cs
index da386c8992f..721ff73a7d9 100644
--- a/mcs/class/System.Data/System.Data/DataRow.cs
+++ b/mcs/class/System.Data/System.Data/DataRow.cs
@@ -240,8 +240,7 @@ namespace System.Data {
object[] newItems = new object[_table.Columns.Count];
object v = null;
- int i = 0;
- while(i < _table.Columns.Count) {
+ for (int i = 0; i < _table.Columns.Count; i++) {
if (i < value.Length)
v = value[i];
@@ -249,7 +248,6 @@ namespace System.Data {
v = null;
newItems[i] = SetColumnValue (v, i);
- i ++;
}
//FIXME: BeginEdit() not correct
diff --git a/mcs/class/System.Data/System.Data/DataSet.cs b/mcs/class/System.Data/System.Data/DataSet.cs
index 125bad5fb4a..4faa8e0fd15 100644
--- a/mcs/class/System.Data/System.Data/DataSet.cs
+++ b/mcs/class/System.Data/System.Data/DataSet.cs
@@ -243,7 +243,11 @@ namespace System.Data {
public void Clear()
{
- throw new NotImplementedException ();
+ // TODO: if currently bound to a XmlDataDocument
+ // throw a NotSupportedException
+ for (int t = 0; t < tableCollection.Count; t++) {
+ tableCollection[t].Clear ();
+ }
}
public virtual DataSet Clone()
@@ -420,6 +424,9 @@ namespace System.Data {
public void WriteXml(XmlWriter writer, XmlWriteMode mode)
{
+ if (writer.WriteState == WriteState.Start)
+ writer.WriteStartDocument (true);
+
((XmlTextWriter)writer).Formatting = Formatting.Indented;
WriteStartElement( writer, mode, Namespace, Prefix, DataSetName );
diff --git a/mcs/class/System.Data/System.Data/DataTable.cs b/mcs/class/System.Data/System.Data/DataTable.cs
index 4ef5914e16a..c905ec88cf8 100644
--- a/mcs/class/System.Data/System.Data/DataTable.cs
+++ b/mcs/class/System.Data/System.Data/DataTable.cs
@@ -409,6 +409,12 @@ namespace System.Data {
/// Clears the DataTable of all data.
/// </summary>
public void Clear () {
+ // TODO: thow an exception if any rows that
+ // have enforced child relations
+ // that would result in child rows being orphaned
+ // TODO: throw a NotSupportedException if the DataTable is part
+ // of a DataSet that is binded to an XmlDataDocument
+
_rows.Clear ();
}
@@ -431,8 +437,29 @@ namespace System.Data {
[MonoTODO]
public object Compute (string expression, string filter)
{
- //FIXME: //Do a real compute
- object obj = "a";
+ // TODO: implement this function based
+ // on Select (expression)
+ //
+ // expression is an aggregate function
+ // filter is an expression used to limit rows
+
+ object obj = null;
+
+ // filter rows
+ ExpressionElement Expression = new ExpressionMainElement (filter);
+
+ ArrayList List = new ArrayList ();
+ foreach (DataRow Row in Rows) {
+
+ if (Expression.Test (Row))
+ List.Add (Row);
+ }
+
+ DataRow[] rows = (DataRow [])List.ToArray (typeof (DataRow));
+
+ // TODO: with the filtered rows, execute the aggregate function
+ // mentioned in expression
+
return obj;
}