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