Re: C# 2.0 + MS Access == Error

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Dave,
Thanks for your reply.
All the tokens are perfectly fine.

SELECT TOP 10 * FROM COMPANY_ITEM_PRICE, ITEM
is working.
BUT
SELECT TOP 10 * FROM COMPANY_ITEM_PRICE, ITEM
WHERE COMPANY_ITEM_PRICE.ITEM_ID = ITEM.ITEM_ID

is giving me the same error. It seem as if Jet has some problem with
comparing two table fields. :(

Dave Sexton wrote:
Hi,

I believe the error is indicating that one or more of the tokens that you are
using does not correspond with any of the DB objects that are currently in
scope.

Is COMPANY_ITEM_PRICE correct?

I'm not sure if this error would occur even when explicitly scoping an object,
such as I.ITEM_ID, but you should probably verify each field name as well and
check to make sure that the fields do exist on the tables that you're
referencing. e.g., Ensure ITEM exists, ITEM_ID is in ITEM and CIP, COMPANY_ID
is in CIP and NAME is in ITEM.

If you are completely sure that the query tokens are all correct, then try to
simplify the query just for the sake of debugging.

i.e., Does the following work for you?

SELECT TOP 10 * FROM COMPANY_ITEM_PRICE, ITEM

If so, then try:

SELECT TOP 10 * FROM COMPANY_ITEM_PRICE, ITEM
WHERE COMPANY_ITEM_PRICE.ITEM_ID = ITEM.ITEM_ID

etc...

--
Dave Sexton

"Omer" <omer.mush@xxxxxxxxx> wrote in message
news:1161354282.288794.153580@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I am using C# 2.0 along with MS Access database. All my queries are
working perfectly fine, but one inner join query is ocntinously
throwing. I ahve tried it both from code and running explicitly throw
query builder, but to no avail. Query is

"SELECT * FROM COMPANY_ITEM_PRICE as CIP
INNER JOIN ITEM as I ON I.ITEM_ID = CIP.ITEM_ID WHERE CIP.COMPANY_ID =
1 ORDER BY I.NAME"

The error its throwing is,

System.Data.OleDb.OleDbException: No value given for one or more
required parameters.
at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
behavior, Object& executeResult)
at
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior
behavior)
at
System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior
behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)

Can anyone please tell me whats wrong iwth the query.


.



Relevant Pages

  • Re: C# 2.0 + MS Access == Error
    ... I believe the error is indicating that one or more of the tokens that you are ... If you are completely sure that the query tokens are all correct, ... DataTabledatatables, Int32 startRecord, Int32 maxRecords, String ... startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# 2.0 + MS Access == Error
    ... Dave Sexton wrote: ... If you are completely sure that the query tokens are all correct, ... DataTabledatatables, Int32 startRecord, Int32 maxRecords, String ... startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# 2.0 + MS Access == Error
    ... Dave Sexton wrote: ... If you are completely sure that the query tokens are all correct, ... DataTabledatatables, Int32 startRecord, Int32 maxRecords, String ... startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQL parsing error
    ... When I send this SELECT string: ... There was an error parsing the query. ... Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior ...
    (microsoft.public.sqlserver.ce)
  • Re: C# 2.0 + MS Access == Error
    ... If you are completely sure that the query tokens are all correct, ... DataTabledatatables, Int32 startRecord, Int32 maxRecords, String ... startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ...
    (microsoft.public.dotnet.languages.csharp)