'2009/08'에 해당되는 글 7건
- 2009/08/25 [cocos2d] Menu - 사용법
- 2009/08/14 인생에 틀어짐을 다시금 잡아 볼까.. (2)
- 2009/08/06 [VS 2003] 웹 서비스 연동시 문제점 발생 - 구성 섹션 system.data을(를) 인식할 수 없습니다. - 해결방법
- 2009/08/05 [sqlite3] Select 쿼리 - 랜덤하게 출력하기
- 2009/08/05 [VC++] 응용 프로그램 구성이 올바르지 않기 때문에 이 응용 프로그램을 시작하지 못했습니다. 오류 해결 방법
- 2009/08/05 [iphone,sqlite3] no such table 오류가 날 경우 / 연동방법
- 2009/08/01 [sqlite] AutoIncrement 처리하기
Menu *menu = [Menu menuWithItems:image, nil];
image.position = cpv( -135, -185);
[self addChild: menu z:2];
가끔은 인생의 목표에 있어서 조금은 다르게 흘러 갈때가 있는거 같다.
돈이 목표가 되고, 잠깐의 단기 목표로 인한 결정으로 인해서
인생의 틀어짐이 생기는거 같다.
하지만 이 틀어짐이 얼마나 멀리 가느냐에 따라서 나의 목표에서 점점 멀어 지고 있는건지
알아 채지 못한다.
이젠 그걸 다시금 되돌릴려고 한다.
단순하게 한달 한달 돈을 벌기 보다, 내가 진정하게 추구 하고자 하는 목표를 위해서.
그걸 위해서 지금의 비 정상적인 종료로 인한 모든 문제는 안고 갈려고 한다.
나쁜넘.. 치사한넘.. 이런 말들은 듣고 그냥 흘러 버리려 한다.
[VS 2003] 웹 서비스 연동시 문제점 발생 - 구성 섹션 system.data을(를) 인식할 수 없습니다. - 해결방법

VS2008에서 .NET 2.0 으로 개발한 웹 서비스를 VS 2003에서 연동이 가능한데요.
아래의 이미지 처럼 "웹 참조 추가"를 통해서 연동이 가능합니다.
정상적으로 연동이 된다면 아래의 화면 처름 보여지게 됩니다.
하지만 아래와 같은 오류가 날때가 있어요.
위의 내용처럼 오류가 난걸 확인해 봤더니..
해당 폴더의 machine.config 의 내용을 보니
<system.data><DbProviderFactories><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /></DbProviderFactories></system.data>
위와 같은 구문이 보였습니다.
헉.. SQLite 라는걸 설치를 하면 여기에 추가 되는걸 이제야 알았네요.. -.-
그래서 이 부분을 삭제를 했습니다.
그리고 나서 프로젝트를 닫고 새로 연 다음에 "웹 참조 추가"를 누르면 정상적으로 되는걸 확인할 수 있습니다.
sqlite3 의 쿼리중에서 select 에서 랜덤하게 뿌리는게 없는줄 알았다. ㅋ.
select * from s1 order by random()
이 쿼리를 사용하면 랜덤하게 출력할 수 있다.
[VC++] 응용 프로그램 구성이 올바르지 않기 때문에 이 응용 프로그램을 시작하지 못했습니다. 오류 해결 방법

VC++ 2008을 작업 하다 보면 다른 pc에서 이런 오류 메시지를 종종 보게 된다.
이때 해결 방법은 몇가지로 나눠 진다.
1. DLL을 같이 배포
- C:\Program Files\Microsoft Visual Studio 9.0\VC\redist 폴더 안에 있는 debug, release 의 내용을 복사해서 같이 배포 한다.
- 사실 이렇게 해봤지만. 되지 않을때가 많다.
2. 배포 패키지를 사용
- 어떤 개발툴(2005, 2008) 둘중에 하나를 쓰게 되는데요. 이때 선택해서 배포 패키지를 깔아서 써야 한다.
Microsoft Visual C 2005 재배포 가능 패키지(x86).exe |
Microsoft Visual C 2008 SP1 재배포 가능 패키지(x8.exe |
Microsoft Visual C 2008 재배포 가능 패키지(x86).exe |
- 위의 3개 중에서 내가 테스트 할때는 2008로 개발했을때인데.. 이때 sp1 빼고 2008 배포 패키지만 깔아도 될때도 있었다.
Tip :
- 컴파일 할때 보면 "다중 스레드 디버그 DLL", "다중 스레드 디버그" 두개가 실행파일의 dll 관계를 보면 좀 틀려 보이긴 한다. 어쩔땐 이걸 해결하면 될때도 있다.. 쩝.. 너무 귀찮다.
[아래 화면은 Tip에 적어 놓은, 걸 Depends로 찍어 본것..]
[iphone,sqlite3] no such table 오류가 날 경우 / 연동방법

-(void) readAnimalsFromDatabase {
// Setup the database object
sqlite3 *database;
// Init the animals Array
// animals = [[NSMutableArray alloc] init];
// Open the database from the users filessytem
if(sqlite3_open([[self dataFilePath] UTF8String], &database) == SQLITE_OK) {
// Setup the SQL Statement and compile it for faster access
NSString* sqlStatement = [NSString stringWithFormat:@"select * from s1"];
sqlite3_stmt *compiledStatement;
if(sqlite3_prepare_v2(database, [sqlStatement UTF8String], -1, &compiledStatement, NULL) == SQLITE_OK) {
// Loop through the results and add them to the feeds array
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
int idx = sqlite3_column_int( compiledStatement, 0 );
int level = sqlite3_column_int( compiledStatement, 1 );
int c1 = sqlite3_column_int( compiledStatement, 2 );
int c2 = sqlite3_column_int( compiledStatement, 3 );
int c3 = sqlite3_column_int( compiledStatement, 4 );
// Create a new animal object with the data from the database
// Animal *animal = [[Animal alloc] initWithName:aName description:aDescription url:aImageUrl];
// Add the animal object to the animals Array
// [animals addObject:animal];
// [animal release];
}
}
else
{
NSString* msg = [[NSString alloc] initWithFormat:@"%s", sqlite3_errmsg( database )];
NSLog( @"Failed to open database with message '%s'.", sqlite3_errmsg( database ) );
}
// Release the compiled statement from memory
sqlite3_finalize(compiledStatement);
}
sqlite3_close(database);
}
** 연동 방법에 대해서는 따로 적지를 않았습니다.
-(void) checkAndCreateDatabase{
// Check if the SQL database has already been saved to the users phone, if not then copy it over
BOOL success;
// Create a FileManager object, we will use this to check the status
// of the database and to copy it over if required
NSFileManager *fileManager = [NSFileManager defaultManager];
// Check if the database has already been created in the users filesystem
success = [fileManager fileExistsAtPath:[self dataFilePath]];
// If the database already exists then return without doing anything
if(success) return;
// If not then proceed to copy the database from the application to the users filesystem
// Get the path to the database in the application package
NSString *databasePathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:kFilename];
// Copy the database from the package to the users filesystem
[fileManager copyItemAtPath:databasePathFromApp toPath:[self dataFilePath] error:nil];
[fileManager release];
}
위의 코드를 수행하게 되면 document에 데이터가 없다면 복사를 수행하라는 의미의 코드인듯 합니다.( 사실 이 부분은 아직 잘 모름 )
그래서 위의 함수를 적용 및 호출을 아래와 같이 해주니까.
제대로 데이터가 불러와 지더군요.
- (id) init
{
if (self = [super init])
{
touchPos = CGPointMake(0, 0);
gameState = kLogo;
logoBack = [[LogoBack alloc] init];
// Execute the "checkAndCreateDatabase" function
[self checkAndCreateDatabase];
// Query the database for all animal records and construct the "animals" array
[self readAnimalsFromDatabase];
}
return self;
}
위의 내용에 대해서 실제적인 코드는 여기 압축을 해서 올리지 못하지만,
sqlite3의 내용을 조금 숙지 하셨다면 금방 이해 하시리라 믿습니다. ^^
이거 가지고 조금 삽질을 했네요.
다행이 이 코드를 보면서 다른 면을 보게 되서 더 기쁘네요 ^^
기본 DB를 만들면 sqlite는 idx등의 고유번호를 자동증가가 안되는거 같다.
그래서 아래와 같이 Execute SQL에서 아래와 같은 쿼리를 통해서
값을 처리 해야 한다.
위와 같이 쿼리를 해서 "Exeture Query" 를 누른다.
위와 같이 s1 이란 것과 "sqlite_sequence" 가 생기게 된다.
Microsoft Visual C 2005 재배포 가능 패키지(x86).exe
Prev
Rss Feed