static int GetTableRowCount(string tableName) {
int count = 0;
SqlCommand cmd = new SqlCommand();
cmd.Connection = getConn();
cmd.CommandText = "SELECT * FROM [" + tableName + "]";
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read()) {
count += 1;
}
return count;
}
Nenhum comentário:
Postar um comentário