rows.count는 행의 수를 알수있고 아래와 같이 list 수를 지정할떄 사용 가능
string[] TestList = { };
using (DataSet ds = BIZ.TestList())
{
TestList = new string[ds.Tables[0].Rows.Count]; // Row Count 개수 생성으로 string list 수를 지정
int i = 0;
foreach (DataRow dr in ds.Tables[0].Rows)
{
TestList[i++] = dr["Firstname"].ToString();
}
}
GitHub 간단한 사용법 요약 (2) | 2022.05.04 |
---|---|
C#[WinForm] ToolBarButton.Visible , CheckOnClick 속성 (1) | 2022.04.29 |
C# 점프문 break, continue, return , goto (2) | 2022.04.25 |
C# split() 매서드 문자열 나누기 (1) | 2022.04.19 |
VB 비주얼스튜디오 자주쓰는 단축키 (1) | 2022.04.19 |