私はこのコードを持っており、文字列ではなく偽と評価されます。そのすべては文字列を作成しています。なぜどんなアイデア?VB.Netでこれがfalseに評価されるのはなぜですか?
Dim statement As String = "Insert into table dbo.IV00101 values(" +
"ITEMNMBR=" + "@ITEMNMBR" + "," +
"ITEMDESC=" + "@ITEMDESC" + " , " +
"NOTEINDX=" + "@NOTEINDX" + "," +
"ITMSHNAM=" + DBNull.Value + "," +
"ITEMTYPE=" + "1" + "," +
"STNDCOST=" + "@STNDCOST" + "," +
"CURRCOST=" + "@CURRCOST" + "," +
"ITEMSHWT=" + "0" + "," +
"DECPLQTY=" + "3" + "," +
"DECPLCUR=" + "3" + "," +
"ITMTSHID=" + DBNull.Value + "," +
"TAXOPTNS=" + "1" + "," +
"IVIVINDX=" + "0" + "," +
"IVIVOFIX=" + "0" + "," +
"IVCOGSIX=" + "0" + "," +
"IVSLSIDX=" + "0" + "," +
"IVSLDSIX=" + "0" + "," +
"IVSLRNIX=" + "0" + "," +
"IVINUSIX=" + "0" + "," +
"IVINSVIX=" + "0" + "," +
"IVDMGIDX=" + "0" + "," +
"IVVARIDX=" + "0" + "," +
"DPSHPIDX=" + "0" + "," +
"PURPVIDX=" + "0" + "," +
"UPPVIDX=" + "0" + "," +
"IVRETIDX" + "0" + "," +
"ASMVRIDX=" + "0" + "," +
"ITMCLSCD=" + DBNull.Value + "," +
"ITMTRKOP=" + "1" + "," +
"LOTTYPEAC=" + DBNull.Value + "," +
"KPERHIST=" + "0" + "," +
"KPTRXHST=" + "0" + "," +
"KPCALHST=" + "0" + "," +
"KPDSTHST=" + "0" + "," +
"ALWBKORD=" + "0" + "," +
"VCTNMTHD=" + "1" + "," +
"UOMSCHDL=" + "@UOMSCHDL" + "," +
"ALTITEM1=" + DBNull.Value + "," +
"ALTITEM2=" + DBNull.Value + "," +
"USCATVLS_1=" + DBNull.Value + "," +
"USCATVLS_2=" + DBNull.Value + "," +
"USCATVLS_3=" + DBNull.Value + "," +
"USCATVLS_5=" + DBNull.Value + "," +
"USCATVLS_4=" + DBNull.Value + "," +
"USCATVLS_6=" + DBNull.Value + "," +
"MSTRCDTY=" + "1" + "," +
"MODIFDT=" + Date.Today.ToString() + "," +
"CREATDDT=" + Date.Today.ToString() + "," +
"WRNTYDYS=" + "0" + "," +
"PRCLEVEL=" + DBNull.Value + "," +
"LOCNCODE=" + DBNull.Value + "," +
"PINFLIDX=" + "0" + "," +
"PURMCIDX=" + "0" + "," +
"IVINFIDX=" + "0" + "," +
"INVMCIDX=" + "0" + "," +
"CGSINFLX=" + "0" + "," +
"CGSMCIDX=" + "0" + "," +
"ITEMCODE=" + DBNull.Value + "," +
"TCC=" + DBNull.Value + "," +
"PriceGroup=" + DBNull.Value + "," +
"PRICMTHD=" + "1" + "," +
"PRCHSUOM=" + DBNull.Value + "," +
"SELNGUOM=" + DBNull.Value + "," +
"KTACCTSR=" + "0" + "," +
"LASTGENSN=" = DBNull.Value + "," +
"ABCCODE=" + "1" + "," +
"Revalue_Inventory=" + "1" + "," +
"Tolerance_Percentage=" + "0" + "," +
"Purchase_Item_Tax_Schedu=" + DBNull.Value + "," +
"Purchase_Tax_Options=" + "1" + "," +
"ITMPLNNNGTYP=" + "1" + "," +
"STTSTCLVLPRCNTG=" + "0" + "," +
"CNTRYORGN=" + DBNull.Value + "," +
"INACTIVE=" + "0" + "," +
"MINSHELF1=" + "0" + "," +
"MINSHELF2=" + "0" + "," +
"INCLUDEINDP=" + "0" + "," +
"LOTEXPWARN=" + "0" + "," +
"LOTEXPWARNDAYS=" + "0" + "," +
"LASTGENLOT=" + DBNull.Value + "," +
"Lot_Split_Quantity=" + "0.00000" + "," +
"DEX_ROW_TS=" + Date.Today.ToString() + "," +
"DEX_RoW_ID=" + "@DEX_RoW_ID" +
")"
すべての古いコメントはどこに行きましたか? – user489041
この "行"に問題があるという事実は、ストリング構築ループがより良い実装になることを示す良い指標です。 @dlevが発見されたので、** 249 **プラスシンボルの1つだけがエラーになりました。ループには4つのプラス記号maxしかないので、この種のエラーはすぐに表示されます。 –
ビジュアルベーシックで文字列を連結するときは、+の代わりに&演算子を使用する方が良いでしょう。 +演算子には、エラーを追加、連結、またはスローするかどうかを判断するための複雑なルールセットがあります。 &演算子は文字列オペランドのみであり、常にオペランドをStringに拡張します。 – briddums