Question : I am having problems with this select string?? ms/sqlserver select

Unclosed quotation mark after the character string ') Order by e.dtmEvent
=====================================================================
SELECT e.dtmEvent,e.strTitle,r.strName,r.strEmail, r.fltOrderAmount,r.strRegistrationStatusID,r.dtmCreated FROM i2Integration_EventRegv45_Event e,i2Integration_EventRegv45_Registration r  where e.intEventID = r.intEventID and r.strPaymentMethodID = 'pp' and ((r.strRegistrationStatusID = 'cmp') or (r.strRegistrationStatusID = 'agw')) and r.blnEmailSent=1 and (YEAR(e.dtmEvent) = '" + ddlYear.SelectedValue + "' AND MONTH(e.dtmEvent) = '" + ddlMth.SelectedValue + "' AND e.strTitle = '" + DroplistData.SelectedValue.Tostring.replace("'","''") + "') Order by e.dtmEvent

Answer : I am having problems with this select string?? ms/sqlserver select

I am guessing you have an application to build your statement - due to the fact, you refer to elements that offer a SelectedValue property.

DropDownList-replace Element will cause the problem.
Maybe you can do it like that:
1:
2:
...
AND e.strTitle = '" + DroplistData.SelectedValue.Tostring.replace("'","\"") + ") Order by e.dtmEvent
Random Solutions  
 
programming4us programming4us