[Help]Converting DWORD To SQL Bigint

05/09/2012 01:01 robobot#1
hey,
how can i convert c++ DWORD to sql server bigint? or how else can i save DWORD in sql server?
05/09/2012 08:31 Tyrar#2
Code:
std::stringstream ss;
DWORD dwValue=1337;

ss << "INSERT INTO dwordtable VALUES (" << dwValue << ");";

mysql_query(p_mysql,ss.str().c_str());
05/09/2012 09:23 EXTEЯNAL#3
Code:
DWORD dwMyVal = 0x12345678;
char szSqlQuery[128];
sprintf_s(szSqlQuery, 128, "INSERT INTO dwordtable VALUES (%i);", dwMyVal);
mysql_query(handle, szSqlQuery);
05/09/2012 12:45 MoepMeep#4
[Only registered and activated users can see links. Click Here To Register...]
05/10/2012 02:39 robobot#5
thanks very much for your answers

Quote:
Originally Posted by Momo5000 View Post
Code:
DWORD dwMyVal = 0x12345678;
char szSqlQuery[128];
sprintf_s(szSqlQuery, 128, "INSERT INTO dwordtable VALUES (%i);", dwMyVal);
mysql_query(handle, szSqlQuery);
so this does work even if the dwMyVal DWORD is a hex value as example 0xF7DC21A9?
05/10/2012 15:29 MoepMeep#6
Quote:
Originally Posted by robobot View Post
thanks very much for your answers



so this does work even if the dwMyVal DWORD is a hex value as example 0xF7DC21A9?
Did you even read my post?

0xF7DC21A9 = 4158398889

Why shouldn't it work? ;o