0
            System.Data.OleDb.OleDbCommandBuilder cb_employees;
            cb_employees = new System.Data.OleDb.OleDbCommandBuilder(da_employees);

            DataRow[] returned_rows_employee;
            returned_rows_employee = ds_employees.Tables["EMPLOYEES"].Select("NIP_EMPLOYEES='" + textNipSearch.Text + "'");

            DataRow row_employees;
            row_employees = returned_rows_employee[0];
            textPesel.Text = row_employees["PESEL_EMPLOYEES"].ToString();
            textName.Text = row_employees["NAME_EMPLOYEES"].ToString();
            textSurname.Text = row_employees["SURNAME_EMPLOYEES"].ToString();
            textPlace.Text = row_employees["PLACE_EMPLOYEES"].ToString();
            textStreet.Text = row_employees["STREET_EMPLOYEES"].ToString();
            textPostalcode.Text = row_employees["POSTAL_CODE_EMPLOYEES"].ToString();
            textNip.Text = textNipSearch.Text;
            textPhone.Text = row_employees["PHONE_CONTACT_EMPLOYEES"].ToString();'

我想在数据库员工中搜索有关 NIP = textNipSearch.Text 的信息,可以,但我想知道返回的行数.... 怎么样?

我打招呼

4

1 回答 1

0

如果我在这里没有遗漏什么,那么您已经有一个 DataRow 对象的集合,所以一个简单的

returned_rows_employee.Length

将返回该集合中的项目数。

于 2012-08-21T07:38:05.177 回答