Thanks...
Tried that and I am having some problem... Here is my code. {ds = DataSet
with data. The Table is DataSettings and one of the 'columns' is called
Temperature}
DataView dv = new DataView();
dv.Table = ds.Tables["DataSettings"];
if (ds != null)
{
dv.RowFilter = "Temperature = ''";
foreach (DataRow dr in dv.Table.Rows)
{
Debug.WriteLine(dr["MashNumber"]);
return dr["MashNumber"].ToString();
}
}
However, when I run this code, I get an error on the foreach statement that:
An unhandled exception of type 'System.Data.EvaluateException' occurred in
system.data.dll
Additional information: Cannot perform '=' operation on System.Double and
System.String.
Any ideas?
Thanks in advance,
Andrew Mueller
"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote
in message news:%2****************@tk2msftngp13.phx.gbl...
Andrew,
You can not do it like this. If the criteria are simple enough, then
you can create a DataView against that DataTable and then set the
RowFilter property on the view to filter out rows that you do not want to process.
You can then cycle through the rows made available to you through the
DataView.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com
"Andrew Mueller" <am******@instechnet.com> wrote in message
news:em****************@TK2MSFTNGP10.phx.gbl... Hello,
Since I cannot query a DataSet directly, and I would like to
maintain it's data, how would I use an adapter (SqlDataAdapter or DataAdapter) to
query this DataSet.
Example: Could I?
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.Fill(myDataSet);
adapter.SelectCommand = "Select * from Table where x = '';
foreach (DataRow dr in adapter.rows)
{
//whatever processing I want here...
}
Andrew Mueller