0

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;
			 nbk=INOMBAMK->Text;//conbobox
			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); 
while(1) 
	{
	rc = SQLFetch(hStmt);
	if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)break;
	String ^ str =gcnew String(chval1);
	TIDBMK->Text=str;//textbox

}

Edited by Nick Evan: fixed code-tags

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by sana_moi
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.