1. WebMethod 만들기
1) 웹서비스 생성
2) Service.asmx 파일에 WebMethod 추가하기
3) 속성 페이지 설정
4) WebMethod를 등록할 웹서버 만들기
포트설정 - 8900
5) 홈디렉토리 설정
6) 홈디렉토리 속성설정
실행권한 - 스크립트 전용
시작페이지 - Service.asmx로 설정
ASP.NET 버전 - 2.0.50727
2. Windows 컨트롤 라이브러리 생성
1) 파일 만들기
2) 웹 참조추가
3) 폼에 그리드 추가하고 Load 이벤트 작성
using System.IO;
private void GridControl_Load(object sender, EventArgs e)
{
SmartControl.Service WebSvr = new SmartControl.Service();
DataSet ds = WebSvr.GetService();
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = ds;
}
4) 빌드후 SmartControl.dll 파일생성
3. ASP페이지 만들기
1) ASP.NET 웹사이트 생성
2) object 태그 추가, dll파일 추가
위에서 만들어논 SmartControl.dll 파일을 C:\C#_TEST\SmartWeb 경로로 복사함
<object id='OBJECT2' style='WIDTH: 700px; HEIGHT: 600px' classid='SmartControl.dll#SmartControl.GridControl'></object>
3) 속성페이지 설정
4) 웹사이트 생성
속성 설정은 위의 웹서버와 동일
단 포트번호는 8901번으로 함
5) 코드 엑세스 설정
< 저장 프로시저 >
1. 예제
CREATE PROC MyCalc
@val1 int = 0,
@val2 int = 0,
@result int OUTPUT
-- WITH ENCRYPTION -- 암호화
-- WITH RECOMPILE -- 재컴파일, 최적화
AS
SET @result = @val1 + @val2
GO
DECLARE @returnVal INT
EXEC MyCalc 1,2, @returnVal OUTPUT
SELECT @returnVal

SmartClient.zip
Prev

Rss Feed