Hi,
I hope Im posting in the right newsgroup. I am trying to insert the
result
of the below SQL query in my Access 2003 table. All the fields in this
table
are of type Number. I'm picking up the value of a dropdownlist box and
insert the relevant values in one row of the table.
if (painPresentComboBox.Text == "RUQ")
{
int painPresent = 301717006;
string assessmentID = assessmentNoTextBox.Text;
Convert.ToInt32(assessmentID);
string insertAssessmentData = "INSERT INTO
abdominalpainassessmentrecords (assessment_id, aap_key, concept_id,
attribute, value) VALUES ('" + assessmentID + "', '1', '21522001',
'363698007', '" + painPresent + "')";
OleDbCommand insertAssessment = new
OleDbCommand(insertAssessmentData, o);
insertAssessment.ExecuteNonQuery();
}
Please Help. Desperate beyond belief
Khurram
Jamie Collins - 20 Jul 2006 11:53 GMT
> I am trying to insert the
> result
[quoted text clipped - 13 lines]
> insertAssessment.ExecuteNonQuery();
> }
Numeric values should not be in single quotes. Try:
string insertAssessmentData = "INSERT INTO
abdominalpainassessmentrecords (assessment_id, aap_key, concept_id,
attribute, value) VALUES (" + assessmentID + ", 1, 21522001,
363698007, " + painPresent + ")";
Jamie.
--
Deecrypt - 20 Jul 2006 18:10 GMT
Thank you, Problem solved. although i also had to take out all the
field names too. Seems does not like field names if the entire row is
going to be populated.
cheers
Khurram
> > I am trying to insert the
> > result
[quoted text clipped - 24 lines]
>
> --