System.Data.Select.Select C# (CSharp) Method

Select() public method

public Select ( DataTable table, string filterExpression, string sort, DataViewRowState recordStates ) : System.Collections.Generic
table DataTable
filterExpression string
sort string
recordStates DataViewRowState
return System.Collections.Generic
        public Select(DataTable table, string filterExpression, string sort, DataViewRowState recordStates)
        {
            _table = table;
            _indexFields = table.ParseSortString(sort);
            if (filterExpression != null && filterExpression.Length > 0)
            {
                _rowFilter = new DataExpression(_table, filterExpression);
                _expression = _rowFilter.ExpressionNode;
            }
            _recordStates = recordStates;
        }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void grdTestGroup_SelectionChanged(object sender, EventArgs e)
        {
            grdTestData.UnCheckAllRecords();
            if (grdTestGroup.CurrentRow != null)
            {
                string rowFilter = "TestType_ID = " + Utility.sDbnull(grdTestGroup.GetValue("TestType_ID"), "-1");
                dtTestDataList.DefaultView.RowFilter = rowFilter;

                dtTestGroupDetail = new Select().From(TTestgroupDtl.Schema.Name).
                    Where(TTestgroupDtl.Columns.TestGroupId).IsEqualTo(Utility.Int32Dbnull(grdTestGroup.GetValue("TestGroup_ID"))).
                    ExecuteDataSet().Tables[0];
                foreach (GridEXRow exRow in grdTestData.GetRows())
                {
                    if (dtTestGroupDetail.Select(string.Format("TestGroup_ID = {0} And TestData_ID = '{1}'",
                        Utility.Int32Dbnull(grdTestGroup.GetValue("TestGroup_ID")),
                        Utility.sDbnull(exRow.Cells["TestData_ID"].Value))).Length > 0)
                    {
                        exRow.CheckState = RowCheckState.Checked;
                    }
                }
            }
            else
            {
                dtTestDataList.DefaultView.RowFilter = "1=2";
                dtTestDataList.AcceptChanges();
            }
        }
All Usage Examples Of System.Data.Select::Select