Counting rows containing data in Dataset;
-
Hi I want to count the rows in a DataTable but it should ignore blank rows, I am trying something this, string batchid = ds.Tables["No"].Columns[0].ColumnName; ds.Tables[0].DefaultView.RowFilter = "" + batchid.Trim() + "=" + string.EmptyString; int records=ds.Tables[0].Rows.counl; the above code showing me following error. Syntax error: Missing operand after '=' operator
Shahzad Aslam Software Engineer Email: shehzadaslam@hotmail.com
-
Hi I want to count the rows in a DataTable but it should ignore blank rows, I am trying something this, string batchid = ds.Tables["No"].Columns[0].ColumnName; ds.Tables[0].DefaultView.RowFilter = "" + batchid.Trim() + "=" + string.EmptyString; int records=ds.Tables[0].Rows.counl; the above code showing me following error. Syntax error: Missing operand after '=' operator
Shahzad Aslam Software Engineer Email: shehzadaslam@hotmail.com
-
You are mixing up code with a string expression.
ds.Tables[0].DefaultView.RowFilter = "" + batchid.Trim() + "=''";
This is still not working and giving the following error: Cannot perform '=' operation on System.Int32 and System.String.
Shahzad Aslam Software Engineer