1
2
3
4
5
6
7
8
9
10
11
12
13
 DataSet dSet = new DataSet(); // 빈 DataSet 생성
 DataTable dTable = new DataTable(); // 빈 DataTable 생성
 // 검색조건(userid)에 해당하는 row만 조회
 DataRow[] dr = ds.Tables[0].Select("userid='" + ID + "'"); 
 // DB테이블 형식 복사 (복사를 해야 Import가능)
 dTable = ds.Tables[0].Clone(); 
 for (int i = 0; i < dr.Length; i++)
 {
    // 형식 복사한 빈 테이블에 조회했던 row 차례로 집어넣기
      dTable.ImportRow(dr[i]);  
 }
 dSet.Tables.Add(dTable); // DataSet에 DataTable 집어넣기
 repeater.DataSource = dSet; // 출력
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public int[] intarry = {1,2,3,4};
 
/// <summary>
/// Host에 해당하는 intarry 값 가져오기
/// </summary>
protected int GetValue()
{
     int retvalue = ChkHost(Request.Url.Host);
 
     return intarry[retvalue];
}
 
/// <summary>
/// Host 체크하기
/// </summary>
public int ChkHost(string host)
{
     int i = 0;
     String[] hosts = {
          "www.a.com",
          "www.b.co.kr",
          "www.c.net",
          "www.d.com"
     };
 
     for (i = 0; i < hosts.Length; i++)
     {
          if (hosts[i].Equals(host)) break;
     }
     return i;
}
cs


1
2
3
4
5
List<string> strList = new List<string>();
 
strList.add("A"); // 리스트에 값 추가
 
string[] strArry = strList.ToArray(); // 리스트를 배열로 변환
cs


1
2
3
4
List<string> str = new List<string>();
str.add("ABC");
 
string[] strArray = str.ToArray();
cs


'프로그래밍 노트 > ASP.NET' 카테고리의 다른 글

Host별로 Value 설정하는 법  (0) 2015.01.09
동적 배열 생성하는 법  (0) 2015.01.09
리피터 순번 넣기  (0) 2015.01.08
웹 폼 이벤트 처리 순서  (0) 2014.04.25
Cookie (쿠키)  (0) 2014.04.25
1
2
3
$ ( ':checkbox[name="chkboxname"]:checked' ).map ( function () {
     return this . value;
}). get(). join ('|')   //'|'은 구분자
cs


+ Recent posts