jjacksn
asked on
String problem with SQL Server
I have a string problem with SQL server, I have code that dynamically generates SQL commands from XML data, one of which is:
query = query.Replace("???TIMESTAM P???", "'" + DateTime.Now.ToString("yyy yMMdd") + "'");
{"ERROR [07002] [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error" } System.Exception
INSERT INTO region_info(prefix, region, last_update) VALUES ('907209', 'Alaska-Juneau', '20040921');
Now, the replace is creating the query of the above line. When I cut and paste that line from the exception text into the Query Analyazer, it runs fine. I'm misisng my problem somewhere.
query = query.Replace("???TIMESTAM
{"ERROR [07002] [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error" } System.Exception
INSERT INTO region_info(prefix, region, last_update) VALUES ('907209', 'Alaska-Juneau', '20040921');
Now, the replace is creating the query of the above line. When I cut and paste that line from the exception text into the Query Analyazer, it runs fine. I'm misisng my problem somewhere.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
exactly "INSERT INTO region_info(prefix, region, last_update) VALUES ('907209', 'Alaska-Juneau', '20040921');"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
nm, it was a different problem.
after this line what does query contain?