"Incorrect syntax near 'nvarchar' " in web page UPDATE Command


this has been kicking butt.  have tried lot suggestions multiple postings can't seem past error.  update command works in sql manager.  when select update on webpage fails.  (vs 2010, c#, sql 2008 r2)

any or guidance appreciate.  (hope onthe right forum)

here latest code:

   <asp:sqldatasource id="sqldatasourcefleetmf" runat="server"          connectionstring="<%$ connectionstrings:mf tool ngconnectionstring1 %>"                   selectcommand="select tbl_mobilefacility.mf_shellsn serial, tbl_configuration.config_code config, tbl_mobilefacility.mf_aslstat [asl status], tbl_mobilefacility.mf_cspcode csp, tbl_mobilefacility.mf_divcode div, tbl_mobilefacility.mf_brcode br, tbl_organization_1.org_nomen tycom, tbl_organization.org_nomen org, tbl_mobilefacility.mf_lastinvdate [last inventory date], tbl_mobilefacility.mf_wspdcode wspd, tbl_mobilefacility.mf_embarkwt [embark weight], tbl_mobilefacility.mf_phyloc physicallocation, tbl_csc.csc_expiredate [csc date], tbl_csc.csc_authnum [csc auth num], tbl_shell.shell_nmau nmau, tbl_shell.shell_partnum shellpartnum, tbl_shell.shell_mfrdate [mfg date], tbl_drawingpackage.pkg_drawnum [drawing package], tbl_drawingpackage.pkg_revnum revision tbl_mobilefacility inner join tbl_organization on tbl_mobilefacility.mf_ownorgid = tbl_organization.orgid inner join tbl_organization tbl_organization_1 on tbl_organization.org_tycom = tbl_organization_1.orgid inner join tbl_drawingpackage on tbl_mobilefacility.mf_pkgid = tbl_drawingpackage.pkgid inner join tbl_configuration on tbl_drawingpackage.pkg_configcode = tbl_configuration.config_code inner join tbl_shell on tbl_mobilefacility.mf_shellsn = tbl_shell.shell_sn inner join tbl_csc on tbl_shell.shell_sn = tbl_csc.csc_shellsn order serial"          updatecommand="update tbl_mobilefacility set mf_brcode = ?,  mf_embarkwt = ?,  mf_phyloc = ?                         values (@mf_brcode, @mf_embarkwt, @mf_phyloc)                         (mf_shellsn = @serial)"        >         <updateparameters>             <asp:formparameter defaultvalue="--" name="mf_phyloc"                  formfield="physical_locationtextbox" type="string" />             <asp:formparameter defaultvalue="0" name="mf_embarkwt"                  formfield="embark_weighttextbox" type="int32" />             <asp:formparameter defaultvalue="000" name="mf_brcode" formfield="brtextbox"                  type="string" />             <asp:formparameter defaultvalue="" formfield="serialtextbox" name="serial"                  type="string" />         </updateparameters>               </asp:sqldatasource>


  after lot of trial , error ended deleting file , code , rebuilt scratch step step using wizards.  works now.

funny thing is, when did file compare between new file , old (source code up), match exactly.

this closed,  suggestions.

p.



SQL Server  >  SQL Server Data Access



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........