Insert Help

R

Rafael

I'm receiving this error from the code below.

Unclosed quotation mark before the character string '+1)'.

Line 1: Incorrect syntax near ' + 1)'.).



string InsertDeptType = "INSERT INTO Department(Department_Id,
Department_Desc, Ok_To_Use)"+

" values ('"+ Guid.NewGuid().ToString() +

"','" + drDeptType["DEPT"].ToString()+

"',' + 1)";




SqlCommand cmdInsertDeptType = new SqlCommand(InsertDeptType,
connDestination);

cmdInsertDeptType.ExecuteNonQuery();
 
M

Mike Labosh

"',' + 1)";

Try this instead?

"', 1)";

--
Peace & happy computing,

Mike Labosh, MCSD MCT
Owner, vbSensei.Com
"The power to query ADSI is a power only
one has achieved, but if we work together,
I know we can discover the secrets."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top