https://devblogs.microsoft.com/dotnet/how-to-port-desktop-applications-to-net-core-3-0/

Posted by Sungyoup Han matrim

https://devblogs.microsoft.com/dotnet/are-your-windows-forms-and-wpf-applications-ready-for-net-core-3-0/

Posted by Sungyoup Han matrim

아래 내용은 List<SelectListitem> 을 활용한 dropdownlist 를 만듭니다.
그리고 데이터베이스에 없는 item 을 중간에 끼워넣을 수도 있습니다. 예) -- ALL --


  • View 코드 : Razor

@Html.DropDownList("select_type", ViewBag.selectList as List<SelectListItem>,
new { @class = "form-control", @id="select_type"} )


  • 만들어지는 html

<select class="form-control" id="select_type" name="select_type">
<option value="999999">-- Show ALL --</option>
<option value="1">Choice 1</option>
<option value="2">Choice 1</option>
<option value="3">Choice 1</option>
</select>


  • Controller 코드 : C#
public ActionResult Index()
{
var selectTypesFromDataBase = dbContext.GetSelectTypes(); //db 에서 Type 리스트를 들고 옵니다.
List<SelectListItem> selectTypesList = selectTypesFromDataBase
.Select(c=> new SelectListItem() {
Text = c.desc,
Value = c.id
}).ToList();
selectTypesList.Insert(0, new SelectListItem()
{
Text = "-- Show ALL --",
Value = "999999"
});
ViewBag.selectList = selectTypesList;
return View();
}


Posted by Sungyoup Han matrim

MVC ASP.NET

사용자 테이블에서 PK 인 userId 를 가지고 검색하여 사용자 이름 (userName) 컬럼의 값을 1개 가지고 오는 linq 방법


public string GetUserName(string userId)
{
var sqlResult = context.Users
.Where(c => c.userId.Equals(userId) && c.delete_YN == "N")
.Select(c => c.userName).SingleOrDefault();
return sqlResult;
}


Posted by Sungyoup Han matrim


datatables.js 에서 다음과 같은 방법으로 로딩된 데이터를 csv 로 내보낼 수 있다.

(참조:https://datatables.net/extensions/buttons/examples/html5/simple.html)



<table id="example">


$(document).ready(function() {
    $('#example').DataTable( {
        dom: 'Bfrtip',
        buttons: [
            'copyHtml5',
            'excelHtml5',
            'csvHtml5',
            'pdfHtml5'
        ]
    } );
} );


Posted by Sungyoup Han matrim


datatables.js 사용하며 영문으로 표기된 부분의 언어를 바꾸는 방법은 아래와 같습니다.

[원본: https://datatables.net/reference/option/language ]

{
    "decimal":        "",
    "emptyTable":     "No data available in table",
    "info":           "Showing _START_ to _END_ of _TOTAL_ entries",
    "infoEmpty":      "Showing 0 to 0 of 0 entries",
    "infoFiltered":   "(filtered from _MAX_ total entries)",
    "infoPostFix":    "",
    "thousands":      ",",
    "lengthMenu":     "Show _MENU_ entries",
    "loadingRecords""Loading...",
    "processing":     "Processing...",
    "search":         "Search:",
    "zeroRecords":    "No matching records found",
    "paginate": {
        "first":      "맨처음",
        "last":       "마지막",
        "next":       "다음",
        "previous":   "이전"
    },
    "aria": {
        "sortAscending":  ": activate to sort column ascending",
        "sortDescending"": activate to sort column descending"
    }
}


Posted by Sungyoup Han matrim


[참조]; https://msdn.microsoft.com/en-us/library/ms178473.aspx?f=255&MSPPError=-2147217396


ASP.NET 의 라이프 사이클 관련 MSDN 설명입니다. 위 내용에 들어가 있는 ASP.NET 의 Life Cycle 그림입니다. 





Posted by Sungyoup Han matrim

Visual Studio 2010 에 NuGet Extension 을 설치하려고 하다보니 SP1 이 이미 설치되어 있어서 오류가 납니다.

해결방법은 Hotfix 적용입니다.


링크 : https://support.microsoft.com/ko-kr/hotfix/kbhotfix?kbnum=2581019&kbln=en-us


한국어로는 없고 모든 플랫폼 및 언어를 위한 핫픽스 보기를 누르면 리스트에 픽스가 보이고 선택 후 전자메일을 적으면 링크가 날아옵니다.

메일의 링크를 누르면 파일이 다운되고, 설치 파일 확인 후 설치가 진행 됩니다.


설치가 끝난 후 필요한 Extension 을 설치해 봤습니다.



Extension 이 잘 설치 되었네요. HOTFIX 필요하시면 꼭 다운받으세요

Posted by Sungyoup Han matrim


Windows10 환경에서 visualStudio 2010 에 SpringFramework 닷넷 버전 1.3.2 의 Schema 설치를 위한 수정된 NAnt 스크립트 공유합니다.

바뀐 부분

SOFTWARE\Microsoft\VisualStudio\10.0_Config\InstallDir"

spring-database-1.3.xsd


<?xml version="1.0" ?>
<project name="Spring.NET-Schema" default="deploy-schema">

<target name="locations"
   descriptions="Shows directories where .xsd files will be copied">

  
  <property name="vsXXXX.version" value="VS.NET 2010"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\10.0_Config\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\..\Xml\Schemas"/>
<!-- retrieve location of VS.NET 2010 schema store -->
<readregistry property="vs2010.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="CurrentUser"
failonerror="false"/>
<echo message="VS.NET 2010 xsd install directory = ${vs2010.xml.schemas}${vsXXXX.relative.dir}"/> 

<property name="vsXXXX.version" value="VS.NET 2008"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\9.0\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\..\Xml\Schemas"/>
<!-- retrieve location of VS.NET 2008 schema store -->
<readregistry property="vs2008.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<echo message="VS.NET 2008 xsd install directory = ${vs2008.xml.schemas}${vsXXXX.relative.dir}"/>

<property name="vsXXXX.version" value="VS.NET 2005"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\8.0\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\..\Xml\Schemas"/>
<!-- retrieve location of VS.NET 2005 schema store -->
<readregistry property="vs2005.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<echo message="VS.NET 2005 xsd install directory = ${vs2005.xml.schemas}${vsXXXX.relative.dir}"/>

<property name="vsXXXX.version" value="VS.NET 2003"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\7.1\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\Packages\schemas\xml"/>
<!-- retrieve location of VS.NET 2003 schema store -->
<readregistry property="vs2003.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<echo message="VS.NET 2003 xsd install directory = ${vs2003.xml.schemas}${vsXXXX.relative.dir}"/>
</target>


<target name="deploy-schema"
description="Deploys the Schema to VS.Net schemas dirs. Copies VS 7.0, 7.1, 8.0, 9.0">

<!-- deploy spring schema to the VS.NET 2010 schema store -->
<property name="vsXXXX.version" value="VS.NET 2010"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\10.0_Config\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\..\Xml\Schemas"/>
<!-- retrieve location of VS.NET 2010 schema store -->
<readregistry property="vs2010.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="CurrentUser"
failonerror="false"/>
<property name="vsXXXX.xml.schemas.notinstalled" value="true"/>
<if test="${property::exists('vs2010.xml.schemas')}">
<property name="vsXXXX.xml.schemas" value="${vs2010.xml.schemas}"/>
<call target="_deploy-schema"/>
</if>
<if test="${vsXXXX.xml.schemas.notinstalled}">
<echo message=""/>
<echo message="Failed installing schema files for VS.NET 2010."/>
<echo message=""/>
</if>    
    
<!-- deploy spring schema to the VS.NET 2008 schema store -->
<property name="vsXXXX.version" value="VS.NET 2008"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\9.0\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\..\Xml\Schemas"/>
<!-- retrieve location of VS.NET 2005 schema store -->
<readregistry property="vs2008.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<property name="vsXXXX.xml.schemas.notinstalled" value="true"/>
<if test="${property::exists('vs2008.xml.schemas')}">
<property name="vsXXXX.xml.schemas" value="${vs2008.xml.schemas}"/>
<call target="_deploy-schema"/>
</if>
<if test="${vsXXXX.xml.schemas.notinstalled}">
<echo message=""/>
<echo message="Failed installing schema files for VS.NET 2008."/>
<echo message=""/>
</if>

<!-- deploy spring schema to the VS.NET 2005 schema store -->
<property name="vsXXXX.version" value="VS.NET 2005"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\8.0\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\..\Xml\Schemas"/>
<!-- retrieve location of VS.NET 2005 schema store -->
<readregistry property="vs2005.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<property name="vsXXXX.xml.schemas.notinstalled" value="true"/>
<if test="${property::exists('vs2005.xml.schemas')}">
<property name="vsXXXX.xml.schemas" value="${vs2005.xml.schemas}"/>
<call target="_deploy-schema"/>
</if>
<if test="${vsXXXX.xml.schemas.notinstalled}">
<echo message=""/>
<echo message="Failed installing schema files for VS.NET 2005."/>
<echo message=""/>
</if>


<!-- deploy spring schema to the VS.NET 2003 schema store -->
<property name="vsXXXX.version" value="VS.NET 2003"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\7.1\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\Packages\schemas\xml"/>
<!-- retrieve location of VS.NET 2003 schema store -->
<readregistry property="vs2003.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<property name="vsXXXX.xml.schemas.notinstalled" value="true"/>
<if test="${property::exists('vs2003.xml.schemas')}">
<property name="vsXXXX.xml.schemas" value="${vs2003.xml.schemas}"/>
<call target="_deploy-schema"/>
</if>
<if test="${vsXXXX.xml.schemas.notinstalled}">
<echo message=""/>
<echo message="Failed installing schema files for VS.NET 2003."/>
<echo message=""/>
</if>


<!-- deploy spring schema to the VS.NET 2002 schema store -->
<property name="vsXXXX.version" value="VS.NET 2002"/>
<property name="vsXXXX.xml.schemas.install.dir" value="SOFTWARE\Microsoft\VisualStudio\7.0\InstallDir"/>
<property name="vsXXXX.relative.dir" value="..\Packages\schemas\xml"/>
<!-- retrieve location of VS.NET 2003 schema store -->
<readregistry property="vs2002.xml.schemas" key="${vsXXXX.xml.schemas.install.dir}" hive="LocalMachine"
failonerror="false"/>
<property name="vsXXXX.xml.schemas.notinstalled" value="true"/>
<if test="${property::exists('vs2002.xml.schemas')}">
<property name="vsXXXX.xml.schemas" value="${vs2002.xml.schemas}"/>
<call target="_deploy-schema"/>
</if>
<if test="${vsXXXX.xml.schemas.notinstalled}">
<echo message=""/>
<echo message="Failed installing schema files for VS.NET 2003."/>
<echo message=""/>
</if>
</target>

<!-- 'private' scoped parameterised version of the 'deploy-schema' target -->


<target name="_deploy-schema" depends="_clean">

<!-- deploy schema to VS.NET XXXX schema store -->
<echo message="-------------------------------------------------------"/>
<echo message="Copying spring-objects-1.3.xsd to ${vsXXXX.version} installation."/>
<echo message="-------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-objects-1.3.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="-------------------------------------------------------"/>
<echo message="Copying spring-tool-1.1.xsd to ${vsXXXX.version} installation."/>
<echo message="-------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-tool-1.1.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
   overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-validation-1.3.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-validation-1.3.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-aop-1.1.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-aop-1.1.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-remoting-1.1.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-remoting-1.1.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-database.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-database-1.3.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-tx-1.1.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-tx-1.1.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-nms-1.3.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-nms-1.3.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-ems-1.3.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-ems-1.3.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<echo message="----------------------------------------------------------"/>
<echo message="Copying spring-nvelocity-1.3.xsd to ${vsXXXX.version} installation."/>
<echo message="----------------------------------------------------------"/>
<echo message=""/>
<copy file="spring-nvelocity-1.3.xsd" todir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}"
verbose="true"
overwrite="true"/>

<property name="vsXXXX.xml.schemas.notinstalled" value="false"/>
</target>

  <target name="_clean">
<echo message="-------------------------------------------------"/>
<echo message="Removing previously installed spring schema files"/>
<echo message="from ${vsXXXX.version} installation."/>
<echo message="-------------------------------------------------"/>
<echo message=""/>
    <delete failonerror="false">
      <fileset basedir="${vsXXXX.xml.schemas}${vsXXXX.relative.dir}">
        <include name="spring-*.xsd"/>
      </fileset>
    </delete>
  </target>
</project>


Posted by Sungyoup Han matrim


출처: https://www.windowscentral.com/how-turn-your-windows-10-pc-wireless-hotspot 

윈도우10 노트북에서 와이파이를 공유하고 싶을 때 필요한 세팅 방법입니다.

Posted by Sungyoup Han matrim