Excel의 데이터 셀을 넣고 DataGridview 셀에 쓰는 프로그램이 있습니다. 그러나 단지 데이터의 한 셀을 쓰려고하기 때문에 엑셀 파일의 데이터를 간단한 텍스트 상자에 쓰는 것이 더 나은 아이디어 일 수 있다고 생각합니다.DataGridview에서 간단한 텍스트 박스로 변경
간단한 텍스트 입력란에 Excel 파일을 연결하는 방법을 찾는 데 어려움이 있습니다. 누군가가 내가 이것을 성취 할 수있는 방법에 대한 제안을 가지고 있다면 크게 감사 할 것입니다.
다음은 내 DataGridview를 사용하기위한 현재 코드입니다. rowIndex에 대한
'This code sample here uses a for next loop to match the excel column and rows up with the datagridview's rows and columns.
Dim rowindex As Integer
Dim columnindex As Integer
For rowindex = 1 To DataGridView3.RowCount
For columnindex = 1 To DataGridView3.ColumnCount
objworksheet3.Cells(rowindex + 3, columnindex + 1) = DataGridView3(columnindex - 1, rowindex - 1).Value
Next
Next
'This code uses the oledatadapter to pull only the cells that I want from the excel file to populate the datagridview cell.
MyCommand3 = New OleDbDataAdapter("select * from [myWorksheet$B3:B4]", MyConnection)
ds3 = New System.Data.DataSet()
MyCommand3.Fill(ds3)
은 행과 열을 순환 편집 할 수
더 많은 세포를 가져올하려는 경우 : 예는 첫 번째 열의 첫 번째 행에서 데이터를 검색하는 나의 나쁜, DataGridView에에 – XXXXXXXXXXXXXX
감사 엑셀 보인다 너의 도움으로! 이제 간단한 텍스트 상자의 for-next 루프를 어떻게 구현할 수 있습니까? – stackexchange12