c#에서 sql 데이타를 sqldatareader로 읽고 난 후 어떻게 datagridview로 데이타를 move 할 수 있나요?
작성자SMART 작성시간15.06.06 조회수1068 댓글 8댓글 리스트
-
작성자 SMART 작성자 본인 여부 작성자 작성시간15.06.09 예 저는 page 단위로 나누어서 보기를 원합니다.
그리고 제가 프로그램 수정하여 다시 올립니다. 보시고 알려 주시기 바랍니다.
SqlDataReader reader1 = cmd1.ExecuteReader();
Int i=1;
while (reader1.Read())
{
dataGridView1.Rows.Add();
DataGridViewRow R =dataGridView1.Rows[i];
R.Cells["accID"].Value = reader1[0].ToString();
i = i + 1;
Totalcount = Totalcount + 1;
}
textBox1.Text = Tota -
답댓글 작성자 SMART 작성자 본인 여부 작성자 작성시간15.06.10 먼저 감사합니다. 두시님에게
아래 알려준 방법으로 하여 수정하여 테스트한 결과 dataGridView1.Rows.Add(); 에서 error가 발생합니다
error는 InvalidOperrationException was unhandled 입니다.
Rows cannot be programmatically added to the DataGridView's rows collection when the control is
data-bound 입니다
보시고 아시면 알려 주시기 바랍니다.
감사합니다