|
CSting strid = m_strStringArr.getat(i);
T("INSERT INTO tablename (setid) VALUES('strAnsi')");
This is my query and i get table field and its value at runtime.So how to insert this value.any idea about it..means Setid and stransi i get at runtime..
modified on Monday, September 14, 2009 6:37 AM
|
|
|
|
|
Use CString::Format[^] to create the string.
CString cs;
cs.Format(_T("INSERT INTO tablename (%s) VALUES('%s')"), setid, strAnsi);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
It Works..
Thanks Superman
|
|
|
|
|
But after set this data to fields,every fields ti goes into new line.i dont want this.I want after new line it goes to next line or next record.So how to solve this problem..
|
|
|
|
|
When strAnsi has _T("aaa\nbbb\nccc") then want to make 3 records?
Do you mean like this?
If then, you must split strAnsi at first and make and execute sql 3 times.
For example;
TCHAR* strData = strAnsi.GetBuffer(-1);
TCHAR* pToken = _tcstok(strAnsi, _T("\n"));
while (pToken) {
CString sql;
sql.Format(_T("INSERT INTO tablename (%s) VALUES('%s')"), setid, pToken);
}
strAnsi.ReleaseBuffer();
Well, I dont feel good VALUES('%s') in above sql because of string
escaping issue or SQL-injection problems.
I usually use prepared statements or parameterized query for this purpose.
|
|
|
|
|
Do you really mean this
CString strTable = _T("MyRuntimeValueForTable");
CString strData = _T("MyRuntimeValueForData");
CString strQuery;
strQuery.Format(_T("INSERT INTO %s VALUES ('%s')"), strTable, strData);
?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
hi,
please anyone help me in programming ptz camera query and response commands. pan tilt zoom functionalities are all done but I dont know how to get the angles from ptz camera.I tryed to give the query command and response but have some problem and I dont know how to use this commands of protoocol in c++.. I am using pelco D protocol. please help
|
|
|
|
|
Hi
How to cut rectangles in images ..in dialog based application
thanks and regards
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
See here.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thanks 4 ...your replay
CImage _cImage;
_cImage.Load(_T("D:/2009ga.jpg"));
CRect rect(9175,631,10563,65);
_cImage.Draw(NULL,rect);
_cImage.Save(_T("D:/tct.jpg"));
but the result showing the same image of 2009ga.jpg
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
Hi..
New in c++ application... Now i need play video.. i got Vlc code from corresponding VLC Site.. which have c and c++ code ... I want run that code ... How can i run that project... Which Software we use...
Thanks
|
|
|
|
|
Have a look at [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
anishkannan wrote: Hi..
New in c++ application... Now i need play video.. i got Vlc code from corresponding VLC Site.. which have c and c++ code ... I want run that code ... How can i run that project... Which Software we use...
Thanks
The only response I could think of:
Liquid-Nitrogen[^]
|
|
|
|
|
Outstanding!
Just to let you know where the 5 is from....
|
|
|
|
|
HI all
I am using vs2005, I need to develope application in vc++ for retrivin data from and xml.
can anyone suggesst some ideas.
|
|
|
|
|
Here on CP there are a lots of articles about XML parsers -> here[^]
Regards
Nuri Ismail
|
|
|
|
|
No, useless.
Simply use built-in Win32 XML apis (COM, SAX, and others)
Tons of samples in MSDN in C and C++
|
|
|
|
|
kilt wrote: No, useless.
I don't think so! These articles, from the link I gave, were (and still are) very useful for me!
The next time think again before determining the hardworking people's great contributions (in this case - over 30 articles about XML, here on CP) as useless!!!
You might be a very "constructive" person! I can see your "huge contribution" in your posts[^].
Regards
|
|
|
|
|
Nuri Ismail wrote: You might be a very "constructive" person!
That's the last adjective I'd use to describe him.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Absolutely!
I saw a great "effort" and "clarity" in his posts, so I couldn't resist to be a little bit sarcastic.
Regards
Nuri Ismail
|
|
|
|
|
kilt wrote: Simply use built-in Win32 XML apis (COM, SAX, and others)
These are as built-in as the CP articles.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello Coder
Am new in graphics
can u plz help me to resize .bmp image by factor 2 or 3 or 4.
|
|
|
|
|
There are several ways.
My DLL [^], for instance, provide resizing without too much quality loss.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You beat me with about 10 seconds.
|
|
|
|
|
Nuri Ismail wrote: You beat me with about 10 seconds.
Thank you man for remembering my article
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|