MS MIX10 에서 발표 되었던 MVVM 패턴에 도움을 주는 Toolkit 입니다.

자유롭게 사용할 수 있는 MIT 라이센스로 등록 되어 있구요.

설치 하게 되면 Visual Studio 에서 프로젝트 생성시 MVVM Light Toolkit 기반으로 생성도 가능 하며

Silverlight, WPF, Windows 8 모두 활용이 가능 하도록 제공 되고 있습니다.

 

 

 

다운로드 : http://mvvmlight.codeplex.com/

아래 MSSQL 문을 실행 하면 됩니다.

 

DBCC CHECKIDENT([DB 명], RESEED,0)   // 0은 초기 Index 값

출처 : http://dotnet-experience.blogspot.kr/2011/01/wpf-datagrid-row-double-click.html

 

DataGrid에 마우스 더블 클릭 이벤트를 주고 해당 아이템의 Row 행을 찾는 소스 입니다.

 

 

[XAML 파일]

<DataGrid x:Name="dataGrid" MouseDoubleClick="DataGrid_MouseDoubleClick"/>

 

[CS 파일]

private void DataGrid_MouseDoubleClick(object sender,
                                  System.Windows.Input.MouseButtonEventArgs e)
{
    IInputElement element = e.MouseDevice.DirectlyOver;
    if(element != null && element is FrameworkElement)
    {
        if (((FrameworkElement)element).Parent is DataGridCell)
        {
            var grid = sender as DataGrid;
            if (grid != null && grid.SelectedItems != null
&& grid.SelectedItems.Count == 1)
            {
                var rowView = grid.SelectedItem as DataRowView;
                if (rowView != null)
                {
                    DataRow row = rowView.Row;
                    //do something with the underlying data
                }
            }
        }
    }
}

 

 

 

 

 

 

출처 : http://brentedwards.net/2012/03/11/wpf-datagridrow-double-click-with-mvvm/

 

DataGrid에서 행 더블 클릭 시 이벤트 발생 시키는 소스 입니다.

 

[XAML 파일에 적용]

<DataGrid ... >
   
<DataGrid.ItemContainerStyle>
       
<Style TargetType="DataGridRow">
           
<EventSetter RoutedEvent="MouseDoubleClick" Handler="Row_DoubleClick"/>
       
</Style>
   
</DataGrid.ItemContainerStyle>
    ...Source...
</DataGrid>

 

[CS 파일에 적용]

protected void Row_DoubleClick(object sender, EventArgs args)
{
    var row = sender as DataGridRow;
    if (row != null && row.IsSelected)
    {
        ...Source...
    }
}

 

 

 

 


[테이블 전체 복제]
SELECT * INTO NewTable FROM OldTable

[테이블 컬럼 일부만 복제]
SELECT Column1, Column2 INTO NewTable FROM OldTable

기본 검색 웹 파트에 설정되어 있는 결과 페이지를 수정 하는 방법입니다.

간편하게 수정 하는 방법은 SharePoint 페이지에서 검색 웹 파트를 추가 하신 후에 페이지를 저장하시고,

SharePoint Designer를 통해서 편집 하시면 됩니다.

추가 되어진 웹 파트에서 두 가지 설정을 추가 해주시면 됩니다.

먼저 UserSiteDefaults 값을 false로 바꿔주시고,

SearchResultPageURL="{결과 페이지}"를 추가 해주신 다음 페이지 체크 아웃을 하시면 됩니다.

 

샘플 코드는 아래 참고하세요!

<MSSWC:SearchBoxEx id="SearchBox"

RegisterStyles="false"

TextBeforeDropDown=""

TextBoxWidth="120"

GoImageUrl="/_layouts/images/publishing/menu_search_btn.gif"

GoImageUrlRTL="/_layouts/images/zim/publishing/menu_search_btn.gif"

UseSiteDefaults="false"

DropDownMode = "HideScopeDD"

SuppressWebPartChrome="true"

runat="server"

WebPart="true"

GoImageActiveUrl="/_layouts/images/publishing/menu_search_btn.gif"

GoImageActiveUrlRTL="/_layouts/images/publishing/menu_search_btn.gif"

SearchResultPageURL="/Search/Pages/PeopleResults.aspx" />

C#에서 Excel에서 Microsoft.Office.Interop.Excel namespace를 이용해 파일을 저장할 때 기본 파일로 저장을 하게 되면

Cell 너비나 높이, 폰트 사이즈 등을 개별적으로 설정하기가 힘듭니다.

엑셀 템플릿을 불러와서 템플릿 파일을 이용해 Cell 스타일을 입혀서 저장 하는 방식입니다.

 

아래 소스는 엑셀 저장 소스 중 템플릿을 가져오는 예제 소스 입니다.

….

….

Excel.Application oXL = null;
Excel._Workbook oWB = null;

Excel._Worksheet oSheet = null;

 

oXL = new Excel.Application();

string path = @"C:\Templates\TemplateTest.xlt";

oWB = oXL.Workbooks.Open(path, 0, false, 5, "", "",

false, Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false);

 

oSheet = (Excel._Worksheet)oWB.ActiveSheet;

oSheet.Cells[2, 2] = "Text";

….

….

SharePoint 2010 패키지를 수동으로 등록 시켜주는 셸 명령어 입니다.

SharePoint 관리 셸에서 실행 합니다.

 

 

솔루션 추가:
Add-SPSolution c:\<path>\<solution filename>.wsp

솔루션 배포/설치:
Install-SPSolution –Identity <solution file>.wsp –WebApplication http://<url> -GACDeployment

솔루션 수정:
Update-SPSolution –Identity <solution file>.wsp –LiteralPath c:\<path>\<solution file>.wsp –GACDeployment

솔루션 배포 취소:
Uninstall-SPSolution –Identity <solution file>.wsp –WebApplication http://<url>

솔루션 삭제:
Remove-SPSolution –Identity <solution file>.wsp

 

MSDN

Add-SPSolution

Install-SPSolution

Update-SPSolution

Uninstall-SPSolution

Remove-SPSolution

Table의 첫번째 행은 보통은 칼럼의 이름이 들어갑니다.
그렇기때문에 첫번째 행을 제외 하는 tr:not(:first) 를 넣어줍니다.

$("#tablename tr:not(:first)").remove();  // tablename이라는 ID를 가진 Table의 첫번째 행을 제외하고 모두 제거

동적으로 테이블의 행을 삭제 추가 할때 유용하게 쓰입니다.

select CONVERT(VARCHAR(50), GETDATE(), 1)

0 Sep 27 2011 8:53AM               
1 09/27/11                         
2 11.09.27                         
3 2027-09-11
4 01.01.12                         
5 2001-01-12
6 01-Jan-12
7 01-Jan-12
8 1:01:01
9 Jan 01 2012 1:01:01:001AM        
10 2001-01-12
11 2012-01-01
12 120101
13 01 Jan 2012 01:01:01:001         
14 01:01:01:001                     
20 2012-01-01 1:01
21 01:01.0
22 2001-01-12 1:01
23 2012-01-01
24 1:01:01
25 01:01.0
100 Jan 1 2012 1:01AM                
101 01/01/2012                       
102 2012.01.01                       
103 01/01/2012                       
104 01.01.2012                       
105 01-01-2012                       
106 01-Jan-12
107 01-Jan-12
108 1:01:01
109 Jan 01 2012 1:01:01:001AM        
110 01-01-2012                       
111 2012-01-01
112 20120101
113 01 Jan 2012 01:01:01:001         
114 01:01:01:001                     
120 2012-01-01 1:01
121 01:01.0
126 2012-01-01T01:01:01.001          
127 2012-01-01T01:01:01.001          
130 01 ???? 1432 1:01:01:001AM       
131 01/01/1432 1:01:01:001AM         

+ Recent posts