+ Start a Discussion

How pass variable to SOQL where clause

I am using sales force API with C#. in the query that I am writing I am not sure how pass parameter to the select query. My query works when it looks like this:
            SOQL = "select AuthorId,Name, Description,Type from Document where AuthorId='005G0000003s4a8IAA'";     

But I am not sure how to replace the value in AuthorId that is '005G0000003s4a8IAA' to variable that I am passing to this method like: id?
You need to add the variable to end of the string, and make sure that its wrapped in quotes itself.  Something like

string a = myAuthor.Id
SOQL = "select AuthorId, Name, Description, Type from Document where AuthorId='" + a + "'";