Click here to Skip to main content
14,774,692 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Richard MacCutchan19-Sep-19 6:24
mveRichard MacCutchan19-Sep-19 6:24 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 6:36
MemberMember 1457555619-Sep-19 6:36 
QuestionRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
David Crow19-Sep-19 6:39
MemberDavid Crow19-Sep-19 6:39 
AnswerRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 6:53
MemberMember 1457555619-Sep-19 6:53 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Richard MacCutchan19-Sep-19 7:09
mveRichard MacCutchan19-Sep-19 7:09 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 7:23
MemberMember 1457555619-Sep-19 7:23 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Victor Nijegorodov19-Sep-19 7:11
MemberVictor Nijegorodov19-Sep-19 7:11 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 7:21
MemberMember 1457555619-Sep-19 7:21 
MedicineDlg MedicineObj;


It is an object for MedicineDlg.

void MedicationDlg::OnBnClickedSaveButtonMedicationDlg()
{
	// TODO: Add your control notification handler code here
	CString m_MedStatusInput, m_MedCommentInput, m_MedDoseInput, m_MedRouteInput, SqlQuery;
	m_MedDose_MedicationDlg.GetLBText(m_MedDose_MedicationDlg.GetCurSel(), m_MedDoseInput);
	m_MedRoute_MedicationDlg.GetLBText(m_MedRoute_MedicationDlg.GetCurSel(), m_MedRouteInput);
	UpdateData(TRUE);
	m_MedStatusInput = m_MedStatus_MedicationDlg;
	m_MedCommentInput = m_MedComments_MedicationDlg;
	
	CDatabase dbobj;
	dbobj.OpenEx(_T("DSN=Demo;UID=root;PWD=root"));
	CRecordset recset(&dbobj);
	SqlQuery.Format(_T("UPDATE dbdemo.medicine SET Route = '%s', Dose = '%s',Status = '%s',Comment = '%s' WHERE NDC ='%s'"), m_MedRouteInput, m_MedDoseInput, m_MedStatusInput, m_MedCommentInput, m_MedDSNInput);
	dbobj.ExecuteSQL(SqlQuery);//till here its working
	MedicineDlg MedicineObj;
	MedicineObj.ResetListControl();// Here the code breaks
	MedicineObj.DatabaseReload();
	
	OnOK();
	
}

GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Victor Nijegorodov19-Sep-19 7:33
MemberVictor Nijegorodov19-Sep-19 7:33 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 7:37
MemberMember 1457555619-Sep-19 7:37 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Victor Nijegorodov19-Sep-19 9:12
MemberVictor Nijegorodov19-Sep-19 9:12 
AnswerRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
David Crow19-Sep-19 7:47
MemberDavid Crow19-Sep-19 7:47 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 7:50
MemberMember 1457555619-Sep-19 7:50 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Victor Nijegorodov19-Sep-19 9:09
MemberVictor Nijegorodov19-Sep-19 9:09 
SuggestionRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
David Crow19-Sep-19 10:29
MemberDavid Crow19-Sep-19 10:29 
QuestionDetermining length of Switch compare Pin
ForNow18-Sep-19 16:45
MemberForNow18-Sep-19 16:45 
AnswerRe: Determining length of Switch compare Pin
Peter_in_278018-Sep-19 17:49
professionalPeter_in_278018-Sep-19 17:49 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 2:32
MemberForNow19-Sep-19 2:32 
AnswerRe: Determining length of Switch compare Pin
Richard MacCutchan18-Sep-19 21:55
mveRichard MacCutchan18-Sep-19 21:55 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 2:32
MemberForNow19-Sep-19 2:32 
AnswerRe: Determining length of Switch compare Pin
Stefan_Lang19-Sep-19 3:23
mveStefan_Lang19-Sep-19 3:23 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 5:06
MemberForNow19-Sep-19 5:06 
AnswerRe: Determining length of Switch compare Pin
leon de boer19-Sep-19 5:38
Memberleon de boer19-Sep-19 5:38 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 6:11
MemberForNow19-Sep-19 6:11 
GeneralRe: Determining length of Switch compare Pin
leon de boer28-Sep-19 15:57
Memberleon de boer28-Sep-19 15:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.