0
ASP.NET을 처음 사용합니다. 나는 각 행을 반환에 대한, 그래서 내가 채우기 위해 API를 호출 할 동적API 응답을 기반으로 GridView 열 데이터 채우기
id User secretcode
1 u1 {response from the API based on the Id value}
2 u1 {response from the API based on the Id value}
3 u1 {response from the API based on the Id value}
4 u1 {response from the API based on the Id value}
5 u1 {response from the API based on the Id value}
id
및 User
내 데이터베이스 테이블 (사용자)에 이미있는 API의 응답에 따라 GridView
에 열을 추가 할 내 세 번째 열, 즉 secretcode
기본적으로 ForEach 루프를 사용할 위치와 혼동을 느낍니다.
이있는 내가 일하고 거친 코드는 다음과 같습니다
DataTable table = new DataTable();
DataColumn col3 = new DataColumn("Secretcode");
col3.DataType = System.Type.GetType("System.Int");
table.Columns.Add(col3);
row[col3] = {response data from API}
gvTest.DataSource = table;
gvTest.DataBind();
thnx 님이 도움을 주셨습니다. –