我写的一段sql语句在SQL中显示,在C#的界面也显示,但是到了查询的时候,却提示错误!!急急
sqlstr = "select V_currentstock.csocode 需求跟踪号,V_currentstock.cbatch 批次,V_currentstock.cwhcode 库别,V_currentstock.cinvcode 料号,V_currentstock.cfree1 包装状况,V_currentstock.cfree2 电源安规,inventory.CINVNAME 名称,SUM(V_currentstock.iquantity) 现存量,SUM(V_currentstock.iquantity-V_currentstock.foutquantity) 可用量,inventory.cInvStd 规格,inventory.cComUnitCode 单位,inventory.CINVDEFINE7 规格补充 from V_currentstock left join inventory on V_currentstock.cinvcode=inventory.cinvcode";
if (this.Invtxtb.Text != "" || this.cmbWa.Text != "")
{
sqlstr += "where V_currentstock.cinvcode='" + Invtxtb.Text + "'or V_currentstock.cwhcode='" + cmbWa.SelectedValue + "'and V_currentstock.iquantity<>0 OR V_currentstock.FINQUANTITY<>0 OR V_currentstock.FOUTQUANTITY<>0 group by V_currentstock.csocode,V_currentstock.cinvcode,V_currentstock.cbatch,V_currentstock.cfree1,V_currentstock.cfree2,V_currentstock.cwhcode,inventory.cinvstd,inventory.ccomunitcode,inventory.CINVNAME,inventory.CINVDEFINE7,V_currentstock.iquantity,V_currentstock.fOutQuantity order by V_currentstock.cbatch desc ";
f.DGVBind(sqlstr, dataGridView1);
}
提示'V_currentstock' 附近有语法错误。求助!!!!