473,513 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading data from database

1 New Member
Hello everyone, I need help with reading data from database. I am working with Visual C++ and MS SQL 2005.
This is the problem:
I have tried to read some values from data base (on a way described below) and it worked when type of data is char, but when they are float it throws error. I know that I should do something with type of data but I don’t know how?
Data in base are float, and I need to read it and write it in textBox, not important in which format.
Every advice will be helpful, because it should be working till Monday.
Thanks in advance and best regards M_Boris.

here is part of my code:

try{
if(radioButton1->Checked==true){
cmd->CommandText="SELECT * FROM Razred_5 WHERE "+"Rb_Ucenika='"+arg1+"'";
cmd->CommandType=CommandType::Text;
cmd->Connection=conn;
conn->Open();
SqlDataReader ^rd;
rd=cmd->ExecuteReader();
while(rd->Read()==true){
textBox8->Text::set(rd->GetString(1));
textBox9->Text::set(rd->GetString(2));
textBox13->Text::set(rd->GetString(3));
}
rd->Close();
conn->Close();
delete rd,arg;
}else{...}
Edit/Delete Message
Dec 16 '06 #1
0 1824

Sign in to post your reply or Sign up for a free account.

Similar topics

7
7068
by: John | last post by:
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and...
2
3016
by: Dariusz | last post by:
Below is part of a code I have for a database. While the database table is created correctly (if it doesn't exist), and data is input correctly into the database when executed, I have a problem...
0
3565
by: Andy | last post by:
Hi, In the code below (not pretty I know but it's an early version :-P) I'm having problems reading the data object back in. If I move the reading code to immediately after the section where it...
2
7361
by: Ed | last post by:
Hope someone can help me out... I have been tasked to read some image data from an sql database and save the files to flat files. OK, sounds easy as I'v used BLOBs before. But this is an old...
7
11767
by: ianenis.tiryaki | last post by:
well i got this assignment which i dont even have a clue what i am supposed to do. it is about reading me data from the file and load them into a parallel array here is the question: Step (1) ...
0
7264
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7166
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7106
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5689
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5094
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.