I am facing error on this,when i execute this line of code then the error IErrorInfo.GetDescription failed with E_FAIL(0x80004005). appeared.
My code
Dim sql As New OleDbCommand("Select Distinct(LOTID) = CASE when LOTID LIKE '%-%' THEN isnull(parsename(replace(LOTID,'-','.'),1),LOTID) ELSE isnull(parsename(replace(LOTID,'-','.'),1),LOTID) END, COUNT(isAvail) as isAvail from ["+csvFile +"] where isAvail = 0 group by LOTID, isAvail ", connx)
I have tried to bracket all the reserved words like this
Select Distinct([LOTID]) = CASE when [LOTID] LIKE '%-%' THEN isnull(parsename(replace([LOTID],'-','.'),1),[LOTID]) ELSE isnull(parsename(replace([LOTID],'-','.'),1),[LOTID]) END, COUNT([isAvail]) as [isAvail] from [" + csvFile + "] where [isAvail] = 0 group by [LOTID], [isAvail]
but the same error still appearing.
User contributions licensed under CC BY-SA 3.0