2017-02-18 6 views
0

인이 dotnetframework4.6.1와 윈도우 10에서 실행 된 programm에있다win10는 유형이 지리

public void GetData() 
{ 
    string sConnectionString; 
     sConnectionString = @"Data Source=www.somedomain.com;Initial Catalog=iislog;Persist Security Info=True;User ID=iislog;Password=password"; 

     SqlConnection Conn = new SqlConnection(sConnectionString); 
     Conn.Open(); 

     SqlDataAdapter adapter; 
     DataSet ds; 
     ds = new DataSet(); 

     adapter = new SqlDataAdapter("Select top 10 name From geo", Conn); 
     adapter.Fill(ds, "name"); 

     adapter = new SqlDataAdapter("Select top 10 geo From geo", Conn); 
     adapter.Fill(ds, "geo"); 

    } 

데이터베이스 엔진 2008 sqlsever 밀리, 지리가 포함 된 테이블 분야를 지원하지 않습니다 필드 유형이 geography 인 필드와 유형이 nvarchar (50) 인 필드가 있습니다.

어댑터에 실행시. 채우기 (ds, "geo"); 예외가 발생했습니다.

하지만 Windows 7에서 프로그램을 실행해도 오류가 발생하지 않습니다.

예외 스크린 샷 :

테이블 구조 :

the table structure

+3

너무 쉽게 만들지 않으려면 예외에 대한 세부 정보를 포함시키지 않았습니까? –

+0

예외 스크린 샷이 추가되었습니다. 감사합니다. – step

답변

0

는 Windows 10 상자에 설치되어 있는지 Microsoft.SqlServer.Types 어셈블리를 확인합니다. SqlGeography에 대한 지원은 .net과 함께 제공되지 않습니다.

+0

작동하지 않습니다. – step