dbTalk Databases Forums  

.NET Issue

sybase.public.sqlanywhere.ultralite sybase.public.sqlanywhere.ultralite


Discuss .NET Issue in the sybase.public.sqlanywhere.ultralite forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Scott Blauert
 
Posts: n/a

Default .NET Issue - 01-15-2010 , 11:49 AM






I am encountering a strange issue which I don't understand.
Our .NET application has a query to our UltraLite database.
The query simply looks into a table for a certain row based
on a varchar ID parameter. The ID parameter is not the
primary key. If the row is found, the primary key of the
row is supposed to be returned. In actuality, if the row is
found, a different row is being returned. The row returned
is always the same. I query the database by inserting the
query into a ULCommand class and return the result to a
ULDataReader class. This technique works without a problem
in many other areas of our application.

I hardcoded one of the IDs into query to troubleshoot the
issue and it is as follows:

SELECT c.c_id
FROM c_master c
WHERE UPPER(c.labeled_id) = 'GLVAAP2'

From within the application. this query is returning the
wrong c.c_id. I have verified the query should return a
different c_id by connecting to a copy of the UltraLite
database using Interactive SQL and running the exact same
query.

There are over 5000 rows in the c_master table and c.c_id is
of type numeric and and c.labeled_id is a varchar.

Has anyone encountered an issue like this before? Thanks in
advance.

Reply With Quote
  #2  
Old   
Kory Hodgson (Sybase iAnywhere)
 
Posts: n/a

Default Re: .NET Issue - 01-15-2010 , 12:00 PM






What version and build of UltraLite are you using?

Can you see if this is reproducible on the latest build, there were a
couple of fixes that could be related?

Can you send the database and a code sample that reproduces this if it
reproduces on the latest build?

Scott Blauert wrote:
Quote:
I am encountering a strange issue which I don't understand.
Our .NET application has a query to our UltraLite database.
The query simply looks into a table for a certain row based
on a varchar ID parameter. The ID parameter is not the
primary key. If the row is found, the primary key of the
row is supposed to be returned. In actuality, if the row is
found, a different row is being returned. The row returned
is always the same. I query the database by inserting the
query into a ULCommand class and return the result to a
ULDataReader class. This technique works without a problem
in many other areas of our application.

I hardcoded one of the IDs into query to troubleshoot the
issue and it is as follows:

SELECT c.c_id
FROM c_master c
WHERE UPPER(c.labeled_id) = 'GLVAAP2'

From within the application. this query is returning the
wrong c.c_id. I have verified the query should return a
different c_id by connecting to a copy of the UltraLite
database using Interactive SQL and running the exact same
query.

There are over 5000 rows in the c_master table and c.c_id is
of type numeric and and c.labeled_id is a varchar.

Has anyone encountered an issue like this before? Thanks in
advance.

Reply With Quote
  #3  
Old   
Chris Keating (Sybase iAnywhere)
 
Posts: n/a

Default Re: .NET Issue - 01-15-2010 , 12:10 PM



What version and build are you running?

Can you expand on the schema for the table - specifically whether there
is an index on "labeled_id".


Scott Blauert wrote:
Quote:
I am encountering a strange issue which I don't understand.
Our .NET application has a query to our UltraLite database.
The query simply looks into a table for a certain row based
on a varchar ID parameter. The ID parameter is not the
primary key. If the row is found, the primary key of the
row is supposed to be returned. In actuality, if the row is
found, a different row is being returned. The row returned
is always the same. I query the database by inserting the
query into a ULCommand class and return the result to a
ULDataReader class. This technique works without a problem
in many other areas of our application.

I hardcoded one of the IDs into query to troubleshoot the
issue and it is as follows:

SELECT c.c_id
FROM c_master c
WHERE UPPER(c.labeled_id) = 'GLVAAP2'

From within the application. this query is returning the
wrong c.c_id. I have verified the query should return a
different c_id by connecting to a copy of the UltraLite
database using Interactive SQL and running the exact same
query.

There are over 5000 rows in the c_master table and c.c_id is
of type numeric and and c.labeled_id is a varchar.

Has anyone encountered an issue like this before? Thanks in
advance.

Reply With Quote
  #4  
Old   
Scott Blauert
 
Posts: n/a

Default Re: .NET Issue - 01-15-2010 , 12:13 PM



I figured out the this issue can be resolved by using
executing the MoveFirst() method on the ULDataReader class
before looking at the results. Apparently, using this
method is necessary in this case to get the correct result.

Quote:
I am encountering a strange issue which I don't
understand. Our .NET application has a query to our
UltraLite database. The query simply looks into a table
for a certain row based on a varchar ID parameter. The ID
parameter is not the primary key. If the row is found,
the primary key of the row is supposed to be returned. In
actuality, if the row is found, a different row is being
returned. The row returned is always the same. I query
the database by inserting the query into a ULCommand class
and return the result to a ULDataReader class. This
technique works without a problem in many other areas of
our application.

I hardcoded one of the IDs into query to troubleshoot the
issue and it is as follows:

SELECT c.c_id
FROM c_master c
WHERE UPPER(c.labeled_id) = 'GLVAAP2'

From within the application. this query is returning the
wrong c.c_id. I have verified the query should return a
different c_id by connecting to a copy of the UltraLite
database using Interactive SQL and running the exact same
query.

There are over 5000 rows in the c_master table and c.c_id
is of type numeric and and c.labeled_id is a varchar.

Has anyone encountered an issue like this before? Thanks
in advance.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.