You know, instead of using a DataSet to read an entire table just to get the number of rows, one could ask the database for just the rowcount directly:
string dbcnstr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=path.mdf;Integrated Security=True;User Instance=True";
SqlConnection conn = new SqlConnection(dbcnstr);
conn.Open();
SqlCommand getRowCount = new SqlCommand("SELECT COUNT(*) FROM pic", conn);
int c = (int)getRowCount.ExecuteScalar();
MessageBox.Show("pic table contains "+ c+" no of rows");
conn.Close();
Of course, this code assumes that you only want to get the number of rows, and not do anything else with the data in your DataSet. If that's not the case then just ignore this answer :)