waelr
December 8th, 2005, 04:59 AM
hey guys
im new to building c++ windows applications.net
to insert data into a table im using the followin code:
sqlConnection1->Open();
sqlCommand1->CommandText = "insert into countries (namecountry) values ('" textBox1->Text "')";
sqlCommand1->ExecuteNonQuery();
MessageBox::Show("Done");
sqlConnection1->Close();
looks like am getting an error with the "textBox1.Text"
when replacing it with :
sqlCommand1->CommandText = "insert into countries (namecountry) values ('France')"; --- it works fine
thank u
im new to building c++ windows applications.net
to insert data into a table im using the followin code:
sqlConnection1->Open();
sqlCommand1->CommandText = "insert into countries (namecountry) values ('" textBox1->Text "')";
sqlCommand1->ExecuteNonQuery();
MessageBox::Show("Done");
sqlConnection1->Close();
looks like am getting an error with the "textBox1.Text"
when replacing it with :
sqlCommand1->CommandText = "insert into countries (namecountry) values ('France')"; --- it works fine
thank u