关于用C#的OleDb导出Excel文件,其中insert语句的列的名称含有特殊符号,一直提示无效的括号名称!
Insert into 20170510092447 ([1.Department No],[2.PLU No],[4.PLU Type],[11.ItemCode],[10.Name],[30.Name2],[31.Name3],[9.Group No],[49.ExeBarcode],[80.Label No],[81.Aux Label No],[55.Origin No],[5.Unit Weight],[100.FixedWeight],[3.Prefix],[14.Pieces],[15.Qty Unit No],[26.Use Fixed Price Type],[6.Price],[91.SpecialPrice],[8.Tax No],[13.Tare],[12.Tare No],[24.%Tare],[23.Tare % limit],[85.Barcode ID],[86.Barcode ID2],[20.ProducedDate],[18.Packed Date],[19.Packed Time],[16.Sell By Date],[17.Sell By Time],[22.CookByDate],[25.Ingredient No],[35.Traceability No],[50.Bonus],[70.NutriFact No],[90.Sales Msg No],[71.Reference Dept],[69.Reference PLU],[64.Coupled Dept],[68.Coupled PLU],[60.# of LinkPLU],[61.Link Dept1],[65.Link PLU1],[62.Link Dept2],[66.Link PLU2],[99.Direct Ingredient],[101.PLU Picture],[102.Use Barcode]) Values (@DepartmentNo,@PLUNo,@PLUType,@ItemCode,@Name,@Name2,@Name3,@GroupNo,@ExeBarcode,@LabelNo,@AuxLabelNo,@OriginNo,@UnitWeight,@FixedWeight,@Prefix,@Pieces,@QtyUnitNo,@UseFixedPriceType,@Price,@SpecialPrice,@TaxNo,@Tare,@TareNo,@FTare,@TareFlimit,@BarcodeID,@BarcodeID2,@ProducedDate,@PackedDate,@PackedTime,@SellByDate,@SellByTime,@CookByDate,@IngredientNo,@TraceabilityNo,@Bonus,@NutriFactNo,@SaleMsgNo,@ReferenceDept,@ReferencePLU,@CoupledDept,@CoupledPLU,@TofLinkPLU,@LinkDept1,@LinkPLU1,@LinkDept2,@LinkPLU2,@DirectIngredient,@PLUPicture,@UseBarcode)
这句运行就会报错,提示 无效的括号名称'[1.Department No]'。哪位大神来看看,百度搜半天,无果。我实在看不出毛病,我用sqlserver去执行都可以(没有用参数,直接给的固定的值),难倒是参数名问题?