SELECT语句包括拼写错误或缺失的保留字或参数名称,或标点符号不正确。帮我

时间:2017-03-21 03:04:00

标签: vb.net

Dim SelectQry = "SELECT (StockID) as [Stock ID],(ProductCode) as [Product Code],(ProductName) as [Product Name],(Weight) as [Weight] as (StockLevel) as [StockLevel],MaxStockLevel,FROM stock where StockLevel> 0   group by StockID, ProductCode,ProductName,Weight,StockLevel order by ProductName "
Dim SampleSource As New DataSet
Dim TableView As DataView

2 个答案:

答案 0 :(得分:0)

你错过了一些东西。 看到这一行

(Weight) as [Weight] as (StockLevel) as [StockLevel],

可能就像它一样

(Weight) as [Weight], (StockLevel) as [StockLevel],

此外,您在FROM

之前添加了额外的逗号

请参阅下面的整个更新查询:

"SELECT (StockID) as [Stock ID],(ProductCode) as [Product Code],(ProductName) as [Product Name],(Weight) as [Weight], (StockLevel) as [StockLevel],MaxStockLevel FROM stock where StockLevel> 0 group by StockID, ProductCode,ProductName,Weight,StockLevel order by ProductName "

答案 1 :(得分:0)

添加到@Vinod的答案:

此外,在FROM子句之前不应该有逗号。