문제

을 작성할 때 매뉴얼 SQL 그것의 아주 쉽게 예상의 모양과 크기에 의해 반환되는 데이터 쿼리를 수행합니다.저는 점점 더 열심히 찾을 수행한 이 LINQ SQL 쿼리를 처리합니다.때때로 내가 찾는 방법보다 더 많이 했을 기대할 수 있는 정말 원격 클라이언트에 액세스하는 데이터베이스를 직접 있습니다.

싶을 수 있는 쿼리를 실행하고 다음 정확히 얼마나 많은 데이터가 반환에 걸쳐 철사,그리고 이것을 사용하는 데 도움이 나를 최적화 할 수 있습니다.

나는 이미를 엮은 로그를 사용하여 매핑되는.로그인 방법이지만,그만이 나에게 표시 SQL,전송되는 데이터 받았습니다.

Any tips?

도움이 되었습니까?

해결책

처럼 보이는 잡을 수 있습니다렇게 하려면 다음과 같이 당신의 매핑되고 전원을 켭 통계입니다.

통계 중 하나는"바이트로 돌아".

MSDN 참조 링크

다른 팁

참고:당신이 필요 캐스팅을 연결하렇게 하려면 다음과 같이 있을 경우에는 기존 매핑되는

 ((SqlConnection)dc.Connection).StatisticsEnabled = true;

다음 검색으로 통계:

 ((SqlConnection)dc.Connection).RetrieveStatistics()

내가 찾는 방법은 없을 잡아렇게 하려면 다음과 같이의 매핑되는,그래서 내가 만들어 이렇게 하려면 다음과 같이 수동:

SqlConnection sqlConnection = new SqlConnection("your_connection_string");
// enable statistics
cn.StatisticsEnabled = true;

// create your DataContext with the SqlConnection
NorthWindDataContext nwContext = new NorthWindDataContext(sqlConnection);

var products = from product in nwContext
               where product.Category.CategoryName = "Beverages"
               select product;
foreach (var product in products)
{
    //do something with product
}

// retrieve statistics - for keys see http://msdn.microsoft.com/en-us/library/7h2ahss8(VS.80).aspx
string bytesSent = sqlConnection.RetrieveStatistics()["BytesSent"].ToString();
string bytesReceived = sqlConnection.RetrieveStatistics()["BytesReceived"].ToString();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top