.net - How to set column value in SQL select statement? -


i want set 1 column value in rows "0"

 sqlcommand cmd = m_objdbcapex.getsqlcommand(commandtype.text);   cmd.commandtext = "select capex_billofmaterialitem.* capex_billofmaterialitem,capex_billofmaterial capex_billofmaterialitem.szbillofmaterialid = capex_billofmaterial.szbillofmaterialid , capex_billofmaterial.szprojectcode = '" + szprojectcode + "'";   da = new sqldataadapter(cmd);  da.fill(dtdat); 

adding point @rahul's answer.

if field has specific values , if want alone make 0 need case statements.

select case           when capex_billofmaterialitem.fieldname = 'checking value goes here'         0           else capex_billofmaterialitem.fieldname         end fieldname1,         capex_billofmaterialitem.*    capex_billofmaterialitem,         capex_billofmaterial   capex_billofmaterialitem.szbillofmaterialid =                capex_billofmaterial.szbillofmaterialid         , capex_billofmaterial.szprojectcode = '" + szprojectcode + "' 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -