ASP.NET(C#) 에서 크리스탈 리포트를 게시하였다.

모든 구글에서 데이터베이스에서 바로 불려오는 것의 예제가 있어서 거의 생략하고...

DataSet 베이스로 재 프로그래밍하였다.

비쥬얼 스튜디오 2008에서 빌드하면 이상없이 배포가 되는데..

이것을 IIS (Windows XP SP3)에 배포한 후에 익스플로워에서 볼 경우 Crystal Reports의 상단의 이미지가 깨져서 보였다. (ASP.NET Crystal Reports image field not showing)

구글에서 이것 저것 검색하다가 CrystalImageHandler에 닷넷의 버전이 있었다.

또한 이미지의 링크를 보니 aspnet_client 밑의 폴더로 되어 있었다.


그래서 IIS 설정 폴더를 보니.. 역시나 system_web 폴더 밑에 2.0 폴더에는 Crystal Report 폴더가 있지만, 4.0 에는 없었다.


같은 폴더를 4.0에서도 복사하여 붙여주니 정상적으로 작동!!!


ASP.NET을 사용하면서 제일 어려운 것은 아마 배포하기가 아닌듯하다.

PHP에 익숙하다가 툴을 사용하려니...

프로그램하는 시각보다 셋업하고 설정하는데 더 오래 걸리는듯...

Windows 7에서도 이런 문제가 발생할지 모르겠다. 곧 컴터 업그레이드 계획인데..ㅠㅠ



Posted by 노을지기

Windows XP에 IIS을 설치한 후 sample sorce을 Virtual drectory에 넣었다.

하지만, Configuration Error 에러 메시지가 나오는 현상이다.

Server Error in '/test' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

Source Error:

Line 22: 			</controls>
Line 23: 		</pages>
Line 24: 		<compilation debug="true" targetFramework="4.0">
Line 25: 			<assemblies>
Line 26: 				<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

Source File: H:\700.project 2012\testweb\web.config    Line: 24


Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3634


문제는 다름 아닌 아래쪽 메시지에서 찾을 수 있었다.


Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3634

구글에서 검색한 결과 다들 .NET 버전을 확인하라고 하는데....

처음엔 무슨 말인지 몰랐다.

그런데 IIS에서 ASP.NET 탭을 본 기억이 나서 확인 한 결과....

( IIS >  Right click on WebSite > Properties > ASP.NET > Version )



ASP.NET 버전은 4.0 으로 변경하면 정상적으로 보인다.

이것을 몰라서 그동안 완전 고생했었다..ㅡㅡ;;


.

Posted by 노을지기

날짜형을 문자형으로 변경하는 방법은 많이 있었다.

하지만, 숫자형을 날짜형으로 변환하는 방법이 없어서 인터넷을 검색하였다.


숫자형을 날짜형식으로

출처: http://forums.devshed.com/ms-sql-development-95/converting-int-to-date-431988.html

you can't convert an int directly into a date - first you have to convert it to a string and then to a date
e.g. convert(datetime,convert(char(8),20070320),112)

이렇게 할 경우 Left, Mid, Right 함수를 사용하지 않아도 된다는 장점이 있었다.

또한 다음도 지원이 된다.

e.g. convert(date,convert(char(8),20070320),112)

시간이 필요없을 경우..


날짜형을 문자형으로

출처: http://joonsunny.springnote.com/pages/427560

convert() : 검색시 날짜형을 문자형, 문자형을 날짜형, 숫자를 문자형등으로 고쳐

              표현하는 경우 사용.

형식 : CONVERT(바뀔자료형[길이], 바꿀자료원본, 유형)

EX) 날짜(년-월-일) -> 문자열(VARCHAR) 로 변경

      CONVERT(VARCHAR(20), RDATE, 101)

 CAST() : CONVERT함수와 같은 역할

형식 : CAST(바꿀데이터 AS 바뀔자료형)

EX) 숫자를 문자로 변경

      CAST(123 AS CHAR(10))

     문자를 정수로 변경

     CAST('123' AS INT)

Posted by 노을지기

출처: http://blog.sqlauthority.com/2007/07/07/sql-server-convert-text-to-numbers-integer-cast-and-convert/

Thank you, --

-----------------------

SQL SERVER – Convert Text to Numbers (Integer) – CAST and CONVERT

Few of the questions I receive very frequently. I have collect them in spreadsheet and try to answer them frequently.

How to convert text to integer in SQL?
If table column is VARCHAR and has all the numeric values in it, it can be retrieved as Integer using CAST or CONVERT function.

How to use CAST or CONVERT?
SELECT CAST(YourVarcharCol AS INT) FROM Table
SELECT CONVERT(INT, YourVarcharCol) FROM Table

Will CAST or CONVERT thrown an error when column values converted from alpha-numeric characters to numeric?
YES.

Will CAST or CONVERT retrieve only numbers when column values converted from alpha-numeric characters to numeric?
NO.

How to parse/retrieve only numbers from column values contains alpha-numeric characters?
SQL SERVER – UDF – Function to Parse AlphaNumeric Characters from String

What are the online references for CAST and CONVERT?
CAST and CONVERT

Reference : Pinal Dave (http://blog.SQLAuthority.com)

Posted by 노을지기

출처: http://stackoverflow.com/questions/9875485/find-button-in-bindingnavigator-c-sharp


int pos = this.clientBindingSource.Find("id", toolStripTextBox1.Text); 
this.clientBindingSource.Position = pos;

bindingNavigator을 사용하는데, 필요한 값을 찾을 일이 있었다.
구글 검색하니 위와 같이 해주니.. 된다.

역시 구글.. 다 있어..ㅡㅡ;;


Posted by 노을지기