나는 데이터 집합이 있고 마지막으로 int 배열에 저장하려면 datrow 데이터 집합의 모든 ID를 얻으려고합니다. 그게 나를 위해 작동하지 않습니다. 그것은 사전에 "Cannot implicitly convert from type int to int[]"
변환 int int []
Dataset ds = new BusinessLogic().Getsamples(MerchantID);
Datarow dr = ds.Tables[0].Rows[0];
int[] SampleID = Convert.ToInt32(dr["Id"]);
감사합니다 .. 당신은 새로운 INT 배열을 만들고 거기에 지능 넣어야 할
Convert.ToInt32 그들 중 단일의 int없는 배열을 반환합니다 : http://msdn.microsoft.com/en-us/library/sf1aw27b.aspx –
있습니까
은 아마 당신은 무엇인가를 원한다 하나의 ID (단일 int로 캐스트)를 얻거나 ALL ID를 얻으려고합니다. 당신은 코드가 부분 단일, 부분 다중입니다. –