hellow need your help there is my code i try to get the text from combobox & put it in request but when i wont to ut the result of the request in other texbox i figure out that the value is empty :

HSTMT hStmt;
			 char* nbnk;
			 int ret1;
			 char* chval1;
			String^ szSqlint;
			 String^ nbk;
			szSqlint=" select CODE_BANK from BANK where NOM_BANK='"+nbk+"'";
			nbnk = static_cast<char *>(System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(szSqlint).ToPointer());
			rc = SQLAllocStmt(hDbc,&hStmt);
			rc = SQLPrepare(hStmt,(unsigned char*)nbnk, SQL_NTS);//1
			rc = SQLBindCol(hStmt, 1, SQL_C_CHAR, chval1, 50, (SQLINTEGER*)& ret1);
			rc = SQLExecute(hStmt); 
	rc = SQLFetch(hStmt);
	if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)break;
	String ^ str =gcnew String(chval1);


Edited 6 Years Ago by Nick Evan: fixed code-tags

This question has already been answered. Start a new discussion instead.