0 Members and 1 Guest are viewing this topic.
DataTable table = DataSet1.Tables["Orders"]; // Presuming the DataTable has a column named Date. string expression; expression = "Date > #1/1/00#"; DataRow[] foundRows; // Use the Select method to find all rows matching the filter. foundRows = table.Select(expression); // Print column 0 of each returned row. for (int i = 0; i < foundRows.Length; i++) { Console.WriteLine(foundRows[i][0]); }
DataTable table = dataSet1.Tables["DrawingData"]; DataRow[] foundRow; string expression; expression = txtDrawingNumber.Text; //"DrawingNumber = " + foundRow = table.Select(expression); int i = foundRow.Length; if (i == 0) { dataSet1.Tables["DrawingData"].Rows.Add(rw); txtDrawingNumber.Text = String.Empty; dataSet1.Tables["DrawingData"].WriteXml(@"c:\test.xml"); txtDrawingNumber.Focus(); }
"DrawingNumber = '" + SomVariable + "'"
expression = "DrawingNumber = '" + DateTime.Parse(txtDrawingNumber.Text.ToShortDateString() + "'";