|
-
May 30th, 2012, 08:53 PM
#1
[RESOLVED] Help! combobox+mysql
Hello,
I try to make a DBManager gui for testing mysql in vs2010 but have problen wn try to refresh the combobox or clear the combobox bcz is filled w mysql_query.
//-------------------------------------INITDIALOG---IS OK show databases
mysql_query (&mysql,"SHOW DATABASES");
if (res = mysql_store_result(&mysql))
{
max_fld = (int) mysql_num_fields(res);
while (row = mysql_fetch_row(res))
for(int i = 0; i < max_fld; i++)
{
SendDlgItemMessage(hwnd, ID_DBM_DEFAULTDB, CB_ADDSTRING, 0, (LPARAM)row[i]);
}
}else{
MessageBox (hwnd,mysql_error(&mysql),"ERROR", MB_OK | MB_ICONERROR);
mysql_free_result(res);
}
//----------------------------BUT COMMAND When I use drop databases not refresh or clear or update to show dbs i dont know how to that xD
GetDlgItemText(hwnd,ID_DBM_DEFAULTDB,my_del_db,80);
sprintf_s(my_del_query,"DROP DATABASE %s", my_del_db);
if (!mysql_query(&mysql,my_del_query))
{
sprintf_s(my_del_msg,"Deleted Database: %s", my_del_db);
MessageBox (hwnd,my_del_msg,"Delete.", MB_OK | MB_ICONINFORMATION);
}/*(HERE UPDATE THE COMBOBOX)*/
//-----Here I try to paste same code from initdlg but show dual databases
//-----sorry my language im from venezuela ^^ im new programmer.
tkns 4 help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|