문제는 내 webservice에서 내 dataGridView의 데이터를 가져 오는 중입니다. webservice에서 getList 메서드를 호출하면 올바른 XML 코드가 생성됩니다. 이 내 코드입니다 : 웹 서비스 :dataGridView로 데이터 가져 오기
가[WebMethod]
public DataSet getList()
{
SqlConnection connection = new SqlConnection();
connection.ConnectionString = "server=localhost;" +
"Trusted_Connection=yes;" +
"database=oving1; " +
"connection timeout=30";
string select = "select * from Person";
SqlDataAdapter da = new SqlDataAdapter(select, connection);
DataSet ds = new DataSet();
da.Fill(ds, "Person");
return (ds);
}
형태 :
private void button1_Click(object sender, EventArgs e)
{
Service1 webService = new Service1();
DataSet ds = webService.getList();
dataGridView1.DataSource = ds;
}
ds를 데이터 테이블에 채우고이 테이블을 그리드보기에 연결하십시오. – Milee
'ds'는 예상대로 채워 집니까? 중단 점을 사용하십시오. – SkonJeet
시도해보십시오 dataGridView1.DataSource = ds.Tables [0], 또한 디자인에서 dataGridView1에 대해 false로 설정 한 자동 생성 된 열을 가지고 있지 않은지 확인하십시오 – Habib