|
-
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.
-
May 31st, 2012, 03:19 AM
#2
-
May 31st, 2012, 09:26 AM
#3
Re: Help! combobox+mysql
 Originally Posted by VictorN
Could you translate what you wrote to some more understandable language?
Sure what you wrote it's not in Spanish! But in what language is it supposed to be? 
Besides, when I was in Venezuela I never saw that someone begins a sentence with a small letter. The same is for country names!
PS: please, use Code tags while posting code snippets. Otherwise it is very hard to read/understand. Check out Announcement: Before you post....
Ok my mistake, how I can edit the post;
I have problem when I try to refresh my combobox because it is filled with mysql_query fields.
thanks for the help
-
May 31st, 2012, 09:36 AM
#4
Re: Help! combobox+mysql
 Originally Posted by v_nom70
Ok my mistake, how I can edit the post;
You'll be able to edit after about 5 posts.
 Originally Posted by v_nom70
I have problem when I try to refresh my combobox because it is filled with mysql_query fields.
 Originally Posted by v_nom70
BUT COMMAND When I use drop databases not refresh or clear or update to show dbs i dont know how to that xD
I'm not sure I understand what you meant... however if you only want to remove all "old" items from the combobox - use CB_RESETCONTENT message.
Victor Nijegorodov
-
May 31st, 2012, 09:43 AM
#5
Re: Help! combobox+mysql
 Originally Posted by VictorN
-use CB_RESETCONTENT message.
SendMessage(hwnd, CB_RESETCONTENT, 0, 0);
Thank you very much works for me, you are great.
-
May 31st, 2012, 09:48 AM
#6
Re: [RESOLVED] Help! combobox+mysql
You are welcome!
Victor Nijegorodov
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
|