'Programming'에 해당되는 글 64건
리스트박스로부터 아이템 지우기
리스트 박스의 컨트롤명이 lstCustomer이다.
btnRemoveCustomer 버튼이 클릭되면 리스트박스에서 선택된 아이템을 삭제하는 코드
사전준비) DB는 SQL서버의 AdventureWorks 데이터베이스를 샘플로 이용합니다.
1. 새로은 웹폼을 ReportProduct.aspx이름으로 하여 작성합니다.
2. ReportProduct.aspx에 MicrosoftReportViewer 컨트롤을 올려 놓습니다.
3. 레포트 폼파일을 저장할 폴더로서 Reports를 생성합니다.
4. Reports폴더에 새로운 레포트 폼을 다음과 같이 추가합니다.
5. 새파일 추가를 통하여 데이터셋 파일을 다음과 같이 추가합니다
6. App_Code 라는 폴더가 자동으로 생성되고 dsProducts.xsd파일이 추가된다.
7. dsProducts파일을 오픈하고 TableAdapter를 추가한다. 8. 데이터 커넥션을 연결하는 창이 나오면 AdventureWorks를 선택한다. 이 때 커넥션이 없으면 New Connection을 통하여 새로운 커넥션을 생성해야 한다.
9. 다음을 계속 클릭하여 SQL을 직접 입력화면으로 이동한다. 그리고 아래의 쿼리문을 입력한다. 그리고 Next를 계속 클릭하여 finish한다.
10. 다음의 테이블 어텝터가 생성된다.
11. ReportProducts.rdlc를 오픈하면 좌측 데이터 소스 패널에 Product 테이블을 볼 수 있다.
12. 툴박스에서 테이블 컨트롤을 추가한다.
13. header행의 첫번째 컬럼 부터 'Product Name', 'Product Number', 'List Price'를 입력한다.
14. Detail행의 첫번째 컬럼에는 Name, 두번째 컬럼은 ProductNumber, 그리고 마지막 컬럼에는 ListPrice를 입력한다.
15. Header 행, Details 행, Footer 행을 모두 선택하고 속성에서 BorderStyle을 Solid로 준다
16. ReportProduct.rdlc 파일을 오픈하고 레포트 뷰어 컨트롤의 스마트 태그에서 레포트폼파일을 연결해준다.
17. 레포트 컨트롤의 폭을 800으로 조정한다.
페이지를 로드하면 다음의 화면이 펄쳐진다.
레포트폼을 Sql서버에 저장할 수도 있으나 웹프로젝트에 폼파일을 포함하는 형식을 취했다.
WindowsServer2003-KB892777-SupportTools-x86-ENU.exe 다음의 링크로부터 해당 파일을 다운받는다.
httpcfg set iplisten -i 실제IP
위의 명령에 의하여 IIS는 외부에게도 서비스를 제공할 수 있으며 아파티는 localhost(127.0.0.1)만 사용하게 된다
리스닝되는 목록을 보려면
httpcfg query iplisten
리스닝 목록 삭제하려면 httpcfg delete iplisten -i 000.000.000.000
--- 원문 ============
To add an IP address to the IP inclusion list
- Click Start, and then click Run.
- Type cmd, and then click OK to open a command prompt.
- Type the following, where xxx.xxx.x.x is the IP address you want to add:
httpcfg set iplisten -i xxx.xxx.x.xWhen this succeeds, Httpcfg returns the following:
To view additional status codes, see the Httpcfg help. - After the IP address is added, use the following command to list it:
httpcfg query iplistenHttpcfg returns the following:
- From the command prompt, stop the HTTP service and its dependent services. To do this, type the following string at the command prompt:
net stop http /y
- From the command prompt, restart the HTTP service and it dependent services. To do this, type the following string at the command prompt:
net start w3svcNote When you start w3svc, all services that were stopped when HTTP was stopped will start.
visibility: 영역을 차지한다.
display: 영역을 차지하지 않는다.
** Usage
http://www.aladdin.co.kr/shop/wproduct.aspx?ISBN=8992939159&ttbkey=ttbahnyounghoe1428002©Paper=1
팀장이되기이기 위해서, 팀장인데 고민이 많을때... 읽어 보자
ASP.NET, C#으로 된 Free, open source, web-based bug tracker이자 이슈 트래커
데모는 아래의 링크에서
http://www.ifdefined.com/btnet/bugs.aspx
[vb.net] class에 대한 clone의 구현
class는 레퍼런스 타입인데 여기에 ICloneable의 Clone메서드를 구현하여 class의 내부값들을 그대로 복제할 수 있는 기능을 구현한다. 레퍼런스 타입은 하나의 메모리를 가리키고 있으므로 특정 인스턴스 값을 변경하면 다른 인스턴스의 값도 변경된다. 이를 극복하기 위하여 Clone 을 사용한다.
MemberwiseClone 메소드는 모든 value 타입 필드의 값을 그대로 복제하고 참조 타입인 경우는 참조로서 복제한다. 따라서 클래스 내부에 참조 타입 필드는 새로 생성하여 값을 옮겨 넣는 과정이 필요하다(shopping 클래스의 clone메서드와 order클래스의 clone메서드의 차이)
-- order.vb --
Imports System
Imports System.Text
Imports System.Collections.Generic
Public Class Order
Implements ICloneable
Public OrderNumber As String
Public PONumber As String
Public ShippingAddress As String
Public Sub New(ByVal _OrderNumber As String, ByVal _PONumber As String, ByVal _ShippingAddress As String)
OrderNumber = _OrderNumber
PONumber = _PONumber
ShippingAddress = _ShippingAddress
End Sub
' create a clone
Public Function Clone() As Object Implements System.ICloneable.Clone
Return Me.MemberwiseClone
End Function
Public Overrides Function ToString() As String
Return String.Format("Order Number is {0}, and PO number is {1}", OrderNumber, PONumber)
End Function
End Class
-- shopping.vb --
Imports System
Imports System.Text
Imports System.Collections.Generic
Public Class Shopping
Implements ICloneable
Public Orders As New List(Of Order)
Public Sub New()
End Sub
Public Overrides Function ToString() As String
Dim str As New StringBuilder
For Each e As Order In Orders
str.AppendLine(String.Format("order{0}", e.OrderNumber))
Next
Return str.ToString
End Function
Public Function Clone() As Object Implements System.ICloneable.Clone
Dim newShopping As New Shopping
For Each e As Order In Me.Orders
newShopping.Orders.Add(DirectCast(e.Clone, Order))
Next
Return newShopping
End Function
End Class
-- module 1 --
Module Module1
Sub Main()
Dim originalShopping As New Shopping
originalShopping.Orders.Add(New Order("0001", "P001", "address1"))
originalShopping.Orders.Add(New Order("0002", "P002", "address2"))
originalShopping.Orders.Add(New Order("0003", "P003", "address3"))
Dim clonedShopping As Shopping = DirectCast(originalShopping.Clone, Shopping)
originalShopping.Orders(0).OrderNumber = "0005"
originalShopping.Orders(0).PONumber = "P005"
originalShopping.Orders(0).ShippingAddress = "address5"
Console.WriteLine(originalShopping.ToString)
Console.WriteLine(clonedShopping.ToString)
Console.ReadLine()
End Sub
End Module