'분류 전체보기'에 해당되는 글 365건
- 2014.07.15 M6S 메모리칩셋
- 2014.06.26 telerik:GridView내 button command 먹이기.
- 2013.10.11 상위 몇개 업데이트 : UPDATE with TOP ()
- 2013.07.15 TrimTrailingBlanks가 Yes로 된것 No 로변경
- 2013.06.24 UltraWinGrid 키설정, 입력문자열수, 중복제거, 가로변환
- 2013.06.24 UltraGrid 정렬, 필터하기
- 2013.05.20 DTC 설정
- 2013.05.07 UltraGrid Filter Sort(자체지원 필터,정렬 적용후 값가져오기)
- 2013.05.02 DateTime.ToString() 패턴.
- 2013.05.02 DataTable Select후 행추가
<telerik:GridViewDataColumn Header="부서" Width="150" DataMemberBinding="{Binding DptLstNm}" IsReadOnly="True" >
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<Button Name="btnDeptPop" Margin="2,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"
Command="{Binding DataContext.ShowAuthDept, RelativeSource = {RelativeSource AncestorType={x:Type telerik:RadGridView}}}"
CommandParameter="{Binding AuthSeq}" >
<StackPanel>
<Image Source="../IMG/Search.GIF" Height="17" />
</StackPanel>
</Button>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
업데이트시 수량을 나눠서 업데이트 할려고하는데.
가끔 TOP 뒤에 ()를 안하고 정수를 넣어줘서 안되는경우가 가끔 순간 당황하는 경우가 있었음.
UPDATE TOP (10000) C
FROM XXX AS C
INNER JOIN XXX AS B
ON C.XX = B.XX
TrimTrailingBlanks가 Yes로 된것 No 로변경.
원인은 테이블 만들때. "SET ANSI_PADDING ON" 구문이 제외되어 Yes로 되었네
시스템마다 자동이니 - -.
--구글링을 찾아보니
--http://bytes.com/topic/sql-server/answers/84113-how-change-trimtrailingblanks-no-yes
Update syscolumns
set typestat = typestat |2
where id in ( object_id('테이블명') )
을 넣을려니..
아.. 이룬. 권한이 머시고 - -
음. 없다면,
한개씩 테이블 컬럼 수정(원본 그대로)을 하면 .. 짜잔 바뀜.
SET ANSI_PADDING ON
ALTER TABLE [dbo].[MR_InsufRecInfo]
ALTER COLUMN [ChosNo] [char](14) NULL
개인적인 공간...TagMedia LogLocation LogGuest BookAdminWrite
--------------------------------------------------------------------------------
위에 싸이트가 자세히 되어있을겁니다.
갑자기 사라지는것이 많아. 일단 위치저장~~.
--------------------------------------------------------------------------------
[C#] UltraWinGrid 및 C# 팁정리
.NET (C#)
2009/03/10 11:27
Posted by memorys
[C#] UltraWinGrid 및 C# 팁정리
DataTable에 PrimaryKey설정
DataColumn[] dc = new DataColumn[1];
dc[0] = dt.Columns[0];
dt.PrimaryKey = dc;
dt.AcceptChanges();
-----------------------------------------------------------
DataTable Merge
DataTable dtTemp = dt.Clone();
// PrimaryKey 셋팅(Merge할때 기본키값을 설정하지 않으면 테이블 Merge시 중복된 데이터가 들어갈수 있습니다.
dtTemp.PrimaryKey = new DataColumn[] { dtTemp.Columns[0] };
dtTemp.Merge(dt);
-----------------------------------------------------------
UltraWinGrid Cell에 동적으로 Text변경
// UltraGrid.ActiveCell.Text 가 ReadOnly속성이라 값 셋팅이 안되서 삽질좀 했음 ㅠ
UltraGrid.ActiveCell.SetValue(value, false);
-----------------------------------------------------------
UltraWinGrid에서 변경된값과 변경 전 값 비교
grid.ActiveCell.OriginalValue.Equals(sTmpEmno)
-----------------------------------------------------------
입력된 문자열의 byte수 구하기
Encoding ec = Encoding.GetEncoding("euc-kr");
int iTmp = ec.GetByteCount(grid.ActiveCell.Text);
참고 : Encoding 목록
-----------------------------------------------------------
DataTable에 존재하는 Data중 중복된 값 제거하기
그다지 맘에 들지 않지만.. ㅠ
#region Row, Row를 비교한다.
public static bool RowEqual(object[] Values, object[] OtherValues)
{
if (Values == null) return false;
for (int i = 0; i < Values.Length; i++)
{
if (!Values[i].Equals(OtherValues[i])) return false;
}
return true;
}
#endregion
#region 데이터테이블을 distinct한다.
public static DataTable Distinct(DataTable Table, DataColumn[] Columns)
{
DataTable dt = null;
string sort = string.Empty;
try
{
if (Table != null)
{
dt = new DataTable("Distinct");
for (int i = 0; i < Columns.Length; i++)
{
dt.Columns.Add(Columns[i].ColumnName, Columns[i].DataType);
sort += Columns[i].ColumnName + ",";
}
object[] currentrow = null;
object[] previousrow = null;
DataRow[] sortedrows = Table.Select(string.Empty, sort.Substring(0, sort.Length - 1));
dt.BeginLoadData();
foreach (DataRow row in sortedrows)
{
currentrow = new object[Columns.Length];
for (int i = 0; i < Columns.Length; i++)
{
currentrow[i] = row[Columns[i].ColumnName];
}
if (!RowEqual(previousrow, currentrow))
{
dt.LoadDataRow(currentrow, true);
}
previousrow = new object[Columns.Length];
for (int i = 0; i < Columns.Length; i++)
{
previousrow[i] = row[Columns[i].ColumnName];
}
}
dt.EndLoadData();
}
}
catch (Exception ex) // 프로그램에서 예상하지 못한 Exception을 처리합니다.
{
throw ex;
}
finally // 더 이상 사용하지 않는 자원을 해제합니다.
{
}
return dt;
}
테이블 피봇 (세로 -> 가로)
/// <summary>
/// DataTable를 CrossTab 형태로 변환한는 Class
/// </summary>
public class DataTable2CrossTab : DataTable
{
#region Convert()
public static DataTable Convert(DataTable Source, DataColumn[] RowColumns, DataColumn ColColumn, DataColumn DataColumn)
{
DataTable crossTab = null;
DataColumn[] dynamiccolumns = null;
#region UI Layer에서 MessageBox 처리없이, Exception을 처리하는 Block입니다.
try
{
if (Source != null)
{
crossTab = new DataTable(String.Format("{0}_CrossTab", Source.TableName));
// 1. CrossTab의 Rows의 값을 열을 구성한다.
crossTab.Merge(Distinct(Source, RowColumns));
// 2. CrossTab의 열을 구성할 Row를 만든다.
DataTable temp = Distinct(Source, ColColumn);
dynamiccolumns = new DataColumn[temp.Rows.Count];
for (int i = 0; i < temp.Rows.Count; i++)
{
//crossTab.Columns.Add(temp.Rows[i][ColColumn.ColumnName].ToString(), ColColumn.DataType);
crossTab.Columns.Add(temp.Rows[i][ColColumn.ColumnName].ToString(), DataColumn.DataType);
dynamiccolumns[i] = new DataColumn(temp.Rows[i][ColColumn.ColumnName].ToString(), DataColumn.DataType);
}
// 3. 데이터를 채운다.
foreach (DataRow dr in crossTab.Rows)
{
string filter = string.Empty;
for (int i = 0; i < RowColumns.Length; i++)
{
if (i == 0)
{
if (dr[RowColumns[i].ColumnName].ToString().Length > 0)
{
filter += String.Format("{0} = '{1}'", RowColumns[i].ColumnName, dr[RowColumns[i].ColumnName].ToString());
}
else
{
filter += String.Format("{0} is null", RowColumns[i].ColumnName);
}
}
else
{
if (dr[RowColumns[i].ColumnName].ToString().Length > 0)
{
filter += String.Format(" and {0} = '{1}'", RowColumns[i].ColumnName, dr[RowColumns[i].ColumnName].ToString());
}
else
{
filter += String.Format(" and {0} is null", RowColumns[i].ColumnName);
}
}
}
DataRow[] drs = Source.Select(filter);
for (int i = 0; i < drs.Length; i++)
{
dr[drs[i][ColColumn].ToString()] = drs[i][DataColumn].ToString();
}
}
crossTab.AcceptChanges();
}
}
catch (Exception ex) // 프로그램에서 예상하지 못한 Exception을 처리합니다.
{
throw ex;
}
finally // 더 이상 사용하지 않는 자원을 해제합니다.
{
}
#endregion
return crossTab;
}
#endregion
테이블 피봇 (가로 -> 세로)
#region ConvertRow2Col()
/// <summary>
/// Row를 Column 으로 Column을 Row로 바꾸는 메소드
/// </summary>
/// <param name="Source">DataTable</param>
/// <param name="StardardColumn">기준컬럼</param>
/// <param name="DataType">데이터형</param>
/// <returns></returns>
public static DataTable ConvertRow2Col(DataTable Source, DataColumn StardardColumn, Type DataType)
{
DataTable dtNew = new DataTable();
// 기준컬럼 만들기
DataColumn dcCol = new DataColumn(StardardColumn.ColumnName, Type.GetType("System.String"));
dtNew.Columns.Add(dcCol);
// 기준컬럼에 해당하는 행을 컬럼으로 변환하기
DataColumn dcTemp = null;
foreach (DataRow row in Source.Rows)
{
if (StardardColumn.DataType == Type.GetType("System.DateTime"))
{
dcTemp = new DataColumn(row[StardardColumn].ToString().Substring(0, 10), DataType);
}
else
{
dcTemp = new DataColumn(row[StardardColumn].ToString(), DataType);
}
dtNew.Columns.Add(dcTemp);
}
// 기준 컬럼 Remove
Source.Columns.Remove(StardardColumn);
// 컬럼 정보를 행으로 변환
foreach (DataColumn col in Source.Columns)
{
DataRow dr = dtNew.NewRow();
dr[StardardColumn.ColumnName] = col.ColumnName;
dtNew.Rows.Add(dr);
}
for (int i = 0; i < Source.Columns.Count; i++)
{
for (int j = 0; j < Source.Rows.Count; j++)
{
dtNew.Rows[i][j+1] = Source.Rows[j][i];
}
}
dtNew.AcceptChanges();
return dtNew;
}
#endregion
Trackback 0 Comment 2
Trackback :: http://akddd.net/trackback/188
UltraGrid 정렬, 필터하기
dgList1는 UltraWinGrid로, LemBand은 자체컨트롤임. 거의 Band와 비슷할듯.
기존 정렬을 필터가 적용안되어 숨김인덱스를 찾아 처리하였는데,
이것은 필터도 포함이니 숨김인덱스 찾을 필요없음.
//정렬수, 필터수를 가져온다.(필터는 전체를 가져옴)
int iSortedColumnsCount = this.dgList1.LemBand.SortedColumns.Count;
int iColumnFiltersCount = this.dgList1.LemBand.ColumnFilters.Count;
////정렬명, 정렬방식을 넣어줌. 정렬용 임시배열
string[,] strDivSrot = new string[iSortedColumnsCount, 2];
for(int j=0;j<iSortedColumnsCount;j++)
{
strDivSrot[j, 0] = this.dgList1.LemBand.SortedColumns.GetItem(j).ToString();
strDivSrot[j, 1] = this.dgList1.LemBand.SortedColumns[j].SortIndicator.ToString();
}
//필터용 필터,필터세부내용,필터연산자등 필터용 임시배열
ColumnFilter[] cfDivFilt = new ColumnFilter[iColumnFiltersCount];
FilterConditionsCollection[] fcDivFilt = new FilterConditionsCollection[iColumnFiltersCount];
Infragistics.Win.UltraWinGrid.FilterLogicalOperator[] loDivFilt = new Infragistics.Win.UltraWinGrid.FilterLogicalOperator[iColumnFiltersCount];
for (int k = 0; k < iColumnFiltersCount; k++)
{
cfDivFilt[k] = this.dgList1.LemBand.ColumnFilters[k];
fcDivFilt[k] = this.dgList1.LemBand.ColumnFilters[k].FilterConditions;
loDivFilt[k] = this.dgList1.LemBand.ColumnFilters[k].LogicalOperator;
}
.........
//정렬배열이 있으면
if (strDivSrot.Length > 0)
{
//배열이 [X,2]이므로 2로 나누어
for (int j = 0; j < strDivSrot.Length / 2; j++)
{
//Descending이면 true로 필터 추가
this.dgList1.LemBand.SortedColumns.Add(strDivSrot[j, 0], "Descending".Equals(strDivSrot[j, 1]));
}
}
//필터배열이 있으면
if (cfDivFilt.Length > 0)
{
for (int m = 0; m < cfDivFilt.Length; m++)
{
//필터세부내역이 있으면
if (fcDivFilt[m].Count > 0)
{
//혹시모를 키가 변경될수 있으므로 for로 키값확인.
for (int n = 0; n < this.dgList1.LemBand.ColumnFilters.Count; n++)
{
if (this.dgList1.LemBand.ColumnFilters[n].Key.Equals(cfDivFilt[m].Key))
{
//먼서 필터연산자먼저(All(AND), Any(OR))
this.dgList1.LemBand.ColumnFilters[n].LogicalOperator = loDivFilt[m];
foreach (FilterCondition fcNeo in fcDivFilt[m])
{
//세부내역을 넣어줌.
this.dgList1.LemBand.ColumnFilters[n].FilterConditions.Add(fcNeo);
}
}
}
}
}
}
//별도 UltraGrid내 LemControl 사용하는 프레임워크라.. Lem~~ 로시작하는건 지우고 알아서 바꾸면 됩니다.
//UltraGrid Filter Sort
//자체적으로 지원하는 필터, 정렬를 적용후 그값 가져오기.
//UltraGrid.Rows[X].VisibleIndex 값이 -1이아니면 필터에서 보여주는 순서 (이것찾는데 하루 보냈음 - -) IsFilterRow에 사기당함 ㅋㅋ
//필터적용.
//this.dgList1.LemBand.Layout.Override.AllowRowFiltering = DefaultableBoolean.True;
//원본데이터 구조 복사
DataTable dtRef = this.dgList1.LemDataSource.Clone();
//그리드에서 자체적으로 만든 "번호"컬럼은 제외하고 넘기기.
//오류발생으로 참거짓 처리값 밖으로 변경후 삭제
bool isRemovingCol = false;
foreach (DataColumn dc in dtRef.Columns)
{
if ("번호".Equals(dc.ColumnName))
{
isRemovingCol = true;
break;
}
}
//번호컬럼 삭제
if (isRemovingCol) dtRef.Columns.Remove("번호");
//필터링이 안되어있는지 확인값 (총갯수 == 필터링갯수)
bool isNoneFiltering = (this.dgList1.LemGrid.Rows.Count == this.dgList1.LemGrid.Rows.FilteredInRowCount);
for (int i = 0; i < this.dgList1.LemGrid.Rows.Count; i++)
{
if (isNoneFiltering)
{
//데이터 소스로 들어가면 정렬안된값이 들어가므로 다시 넣어줌.
dtRef.Rows.Add(this.dgList1.LemGetColumnColection(i));
}
else
{
//필터링되어 보여질 인덱스 0이상, 없으면 -1
if (this.dgList1.LemGrid.Rows[i].VisibleIndex >= 0)
{
dtRef.Rows.Add(this.dgList1.LemGetColumnColection(i));
}
}
}
구글에서 찾은 내용임.
DateTime.ToString() Patterns
All the patterns:
0 MM/dd/yyyy 08/22/2006
1 dddd, dd MMMM yyyy Tuesday, 22 August 2006
2 dddd, dd MMMM yyyy HH:mm Tuesday, 22 August 2006 06:30
3 dddd, dd MMMM yyyy hh:mm tt Tuesday, 22 August 2006 06:30 AM
4 dddd, dd MMMM yyyy H:mm Tuesday, 22 August 2006 6:30
5 dddd, dd MMMM yyyy h:mm tt Tuesday, 22 August 2006 6:30 AM
6 dddd, dd MMMM yyyy HH:mm:ss Tuesday, 22 August 2006 06:30:07
7 MM/dd/yyyy HH:mm 08/22/2006 06:30
8 MM/dd/yyyy hh:mm tt 08/22/2006 06:30 AM
9 MM/dd/yyyy H:mm 08/22/2006 6:30
10 MM/dd/yyyy h:mm tt 08/22/2006 6:30 AM
10 MM/dd/yyyy h:mm tt 08/22/2006 6:30 AM
10 MM/dd/yyyy h:mm tt 08/22/2006 6:30 AM
11 MM/dd/yyyy HH:mm:ss 08/22/2006 06:30:07
12 MMMM dd August 22
13 MMMM dd August 22
14 yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK 2006-08-22T06:30:07.7199222-04:00
15 yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK 2006-08-22T06:30:07.7199222-04:00
16 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Tue, 22 Aug 2006 06:30:07 GMT
17 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Tue, 22 Aug 2006 06:30:07 GMT
18 yyyy'-'MM'-'dd'T'HH':'mm':'ss 2006-08-22T06:30:07
19 HH:mm 06:30
20 hh:mm tt 06:30 AM
21 H:mm 6:30
22 h:mm tt 6:30 AM
23 HH:mm:ss 06:30:07
24 yyyy'-'MM'-'dd HH':'mm':'ss'Z' 2006-08-22 06:30:07Z
25 dddd, dd MMMM yyyy HH:mm:ss Tuesday, 22 August 2006 06:30:07
26 yyyy MMMM 2006 August
27 yyyy MMMM 2006 August
The patterns for DateTime.ToString ( 'd' ) :
0 MM/dd/yyyy 08/22/2006
The patterns for DateTime.ToString ( 'D' ) :
0 dddd, dd MMMM yyyy Tuesday, 22 August 2006
The patterns for DateTime.ToString ( 'f' ) :
0 dddd, dd MMMM yyyy HH:mm Tuesday, 22 August 2006 06:30
1 dddd, dd MMMM yyyy hh:mm tt Tuesday, 22 August 2006 06:30 AM
2 dddd, dd MMMM yyyy H:mm Tuesday, 22 August 2006 6:30
3 dddd, dd MMMM yyyy h:mm tt Tuesday, 22 August 2006 6:30 AM
The patterns for DateTime.ToString ( 'F' ) :
0 dddd, dd MMMM yyyy HH:mm:ss Tuesday, 22 August 2006 06:30:07
The patterns for DateTime.ToString ( 'g' ) :
0 MM/dd/yyyy HH:mm 08/22/2006 06:30
1 MM/dd/yyyy hh:mm tt 08/22/2006 06:30 AM
2 MM/dd/yyyy H:mm 08/22/2006 6:30
3 MM/dd/yyyy h:mm tt 08/22/2006 6:30 AM
The patterns for DateTime.ToString ( 'G' ) :
0 MM/dd/yyyy HH:mm:ss 08/22/2006 06:30:07
The patterns for DateTime.ToString ( 'm' ) :
0 MMMM dd August 22
The patterns for DateTime.ToString ( 'r' ) :
0 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Tue, 22 Aug 2006 06:30:07 GMT
The patterns for DateTime.ToString ( 's' ) :
0 yyyy'-'MM'-'dd'T'HH':'mm':'ss 2006-08-22T06:30:07
The patterns for DateTime.ToString ( 'u' ) :
0 yyyy'-'MM'-'dd HH':'mm':'ss'Z' 2006-08-22 06:30:07Z
The patterns for DateTime.ToString ( 'U' ) :
0 dddd, dd MMMM yyyy HH:mm:ss Tuesday, 22 August 2006 06:30:07
The patterns for DateTime.ToString ( 'y' ) :
0 yyyy MMMM 2006 August
Building a custom DateTime.ToString Patterns
The following details the meaning of each pattern character. Note the K and z character.
d Represents the day of the month as a number from 1 through 31. A single-digit day is formatted without a leading zero
dd Represents the day of the month as a number from 01 through 31. A single-digit day is formatted with a leading zero
ddd Represents the abbreviated name of the day of the week (Mon, Tues, Wed etc)
dddd Represents the full name of the day of the week (Monday, Tuesday etc)
h 12-hour clock hour (e.g. 7)
hh 12-hour clock, with a leading 0 (e.g. 07)
H 24-hour clock hour (e.g. 19)
HH 24-hour clock hour, with a leading 0 (e.g. 19)
m Minutes
mm Minutes with a leading zero
M Month number
MM Month number with leading zero
MMM Abbreviated Month Name (e.g. Dec)
MMMM Full month name (e.g. December)
s Seconds
ss Seconds with leading zero
t Abbreviated AM / PM (e.g. A or P)
tt AM / PM (e.g. AM or PM
y Year, no leading zero (e.g. 2001 would be 1)
yy Year, leadin zero (e.g. 2001 would be 01)
yyy Year, (e.g. 2001 would be 2001)
yyyy Year, (e.g. 2001 would be 2001)
K Represents the time zone information of a date and time value (e.g. +05:00)
z With DateTime values, represents the signed offset of the local operating system's time zone from Coordinated Universal Time (UTC), measured in hours. (e.g. +6)
zz As z but with leadin zero (e.g. +06)
zzz With DateTime values, represents the signed offset of the local operating system's time zone from UTC, measured in hours and minutes. (e.g. +06:00)
f Represents the most significant digit of the seconds fraction; that is, it represents the tenths of a second in a date and time value.
ff Represents the two most significant digits of the seconds fraction; that is, it represents the hundredths of a second in a date and time value.
fff Represents the three most significant digits of the seconds fraction; that is, it represents the milliseconds in a date and time value.
ffff Represents the four most significant digits of the seconds fraction; that is, it represents the ten thousandths of a second in a date and time value. While it is possible to display the ten thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.
fffff Represents the five most significant digits of the seconds fraction; that is, it represents the hundred thousandths of a second in a date and time value. While it is possible to display the hundred thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.
ffffff Represents the six most significant digits of the seconds fraction; that is, it represents the millionths of a second in a date and time value. While it is possible to display the millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.
fffffff Represents the seven most significant digits of the seconds fraction; that is, it represents the ten millionths of a second in a date and time value. While it is possible to display the ten millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.
F Represents the most significant digit of the seconds fraction; that is, it represents the tenths of a second in a date and time value. Nothing is displayed if the digit is zero.
: Represents the time separator defined in the current DateTimeFormatInfo..::.TimeSeparator property. This separator is used to differentiate hours, minutes, and seconds.
/ Represents the date separator defined in the current DateTimeFormatInfo..::.DateSeparator property. This separator is used to differentiate years, months, and days.
" Represents a quoted string (quotation mark). Displays the literal value of any string between two quotation marks ("). Your application should precede each quotation mark with an escape character (\).
' Represents a quoted string (apostrophe). Displays the literal value of any string between two apostrophe (') characters.
%c Represents the result associated with a c custom format specifier, when the custom date and time format string consists solely of that custom format specifier. That is, to use the d, f, F, h, m, s, t, y, z, H, or M custom format specifier by itself, the application should specify %d, %f, %F, %h, %m, %s, %t, %y, %z, %H, or %M. For more information about using a single format specifier, see Using Single Custom Format Specifiers
// 테이블 전체 복사후 행지움.
DataTable dtFrch = dtClone.Copy();
dtFrch.Clear();
foreach (DataRow drFrch in dtClone.Select("", strSortWord))
{
//DataRow drRow = dtFrch.NewRow();
//drRow.ItemArray = (object[])drFrch.ItemArray.Clone();
//dtFrch.Rows.Add(drRow);
dtFrch.ImportRow(drFrch);
}
===================================
// 중복체크 : 해당컬럼 중복제거후, 해당열의 갯수 확인
//row 갯수를 구할 기준이되는 컬럼명을 대상으로 중복제거
DataTable distinctTable = this.dgSortCol.LemDataSource.DefaultView.ToTable(true, "SortColName");
foreach (DataRow dRow in distinctTable.Rows)
{
string strWhere = dRow["SortColName"].ToString();
DataRow[] arRow = this.dgSortCol.LemDataSource.Select(" SortColName= '" + strWhere + "'");
if (arRow.Length > 1)
{
IB.Framework.Win.Forms.MsgBox.Show(string.Format("{0}은 중복 정렬되어있으니, 중복을 제거해 주십시오.", strWhere));
return false;
}
}