Search found 163 matches

by crazypit
Mon 10 Jan 2011 14:38
Forum: LinqConnect (LINQ to SQL support)
Topic: Support for special hierarchical queries
Replies: 9
Views: 2587

Hello,

It's been half a year now and still nothing mentioned for this issue. Anything new on this?
by crazypit
Fri 07 Jan 2011 08:32
Forum: LinqConnect (LINQ to SQL support)
Topic: File-based XML mapping loading problem
Replies: 20
Views: 3834

It seems that the problem is in the way i use the Datacontext class because the first time the constructor is called, everything works ok and the problem arises on the second call.

Let me explain:

At the start of the program, i load the XML mapping file, create a MappingSource object and keep it in an application wide static property of a static class for future use (ServerSessionRegistry.MappingSource):

Code: Select all

Stream contextStream = File.OpenRead("ExrayDataContext.lqml");
            ServerSessionRegistry.MappingSource =
              Devart.Data.Linq.Mapping.XmlMappingSource.FromStream(contextStream);
            contextStream.Close();
Now, i know that there is a special constructor in the datacontext class which takes a MappingSource parameter but i don't want to use that because i don't want to bulk change all my code references and revert back if a problem arises. So, i changed the private static variable where you load once and keep the mappingsource, from:

Code: Select all

private static readonly MappingSource mappingSource = new AttributeMappingSource();
to:

Code: Select all

private static readonly MappingSource mappingSource = ServerSessionRegistry.MappingSource;
and in this way, a simple change to my static property feeds the datacontext with the appropriate mappingsource.
by crazypit
Fri 07 Jan 2011 08:12
Forum: LinqConnect (LINQ to SQL support)
Topic: Autogeneration of entity files
Replies: 1
Views: 1065

Autogeneration of entity files

Hello,

Whenever i open an lqml file as XML and make some manual changes to it, when i save it, Visual Studio 2010 regenerates all the entity files and associates them with the lqml file! Nevertheless, my entities are maintained in a different folder of my project. This behavior is so annoying. Especially, when an SCC system is present and the new files are automatically marked to be added to the project. Of course, code does not compile as all the new entities are duplicates of my original ones.
by crazypit
Wed 05 Jan 2011 15:20
Forum: LinqConnect (LINQ to SQL support)
Topic: Support for IFormatProvider parameter in Convert.ToDateTime
Replies: 23
Views: 7091

Hello,
Is this fixed in the latest 6.00.70 version?
by crazypit
Tue 28 Dec 2010 15:08
Forum: LinqConnect (LINQ to SQL support)
Topic: File-based XML mapping loading problem
Replies: 20
Views: 3834

Hello,

I removed all Documentation entries from the XML file and the loading seems to work. Nevertheless, i get an exception during the first constructor call :

ArgumentException: An item with the same key has already been added.

at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at Devart.Data.Linq.Mapping.aw.a(DataProvider A_0)
at Devart.Data.Linq.DataContext.a(Object A_0, MappingSource A_1, Type A_2)
at Devart.Data.Linq.DataContext..ctor(String connectionString, MappingSource mapping)

What is the kind of this key? I searched my lqml file and did not find any duplicates and the mapping validates ok.
by crazypit
Mon 27 Dec 2010 12:23
Forum: LinqConnect (LINQ to SQL support)
Topic: File-based XML mapping loading problem
Replies: 20
Views: 3834

File-based XML mapping loading problem

Hello,

When i try to load a file-based XML mapping through the code:

Code: Select all

 Stream contextStream = File.OpenRead("ExrayDataContext.lqml");
            ServerSessionRegistry.MappingSource =
              Devart.Data.Linq.Mapping.XmlMappingSource.FromStream(contextStream);
            contextStream.Close();
I get an XmlSchemaValidation exception with the message "Documentation" and the following stack trace:

at Devart.Data.Linq.Mapping.aj.a(ad A_0, XmlReader A_1)
at Devart.Data.Linq.Mapping.aj.b(ad A_0, XmlReader A_1)
at Devart.Data.Linq.Mapping.aj.c(XmlReader A_0)
at Devart.Data.Linq.Mapping.aj.g(XmlReader A_0)
at Devart.Data.Linq.Mapping.XmlMappingSource.FromReader(XmlReader reader)
at Devart.Data.Linq.Mapping.XmlMappingSource.FromStream(Stream stream)
by crazypit
Fri 10 Dec 2010 16:15
Forum: LinqConnect (LINQ to SQL support)
Topic: Support for IFormatProvider parameter in Convert.ToDateTime
Replies: 23
Views: 7091

Using 3 different servers and 4-5 workstations, we get the same results. In fact, we never encountered the behavior you described in your tests.
The :

Code: Select all

select TO_DATE('24/2/2010 11:52:55 πμ', 'fmDDfm/fmMMfm/YYYY fmHH12fm:MI:SS AM') from dual
throws the ORA-01855 'AM/A.M. or PM/P.M. required' error because it cannot interpret the πμ /μμ in my date, as the default nls language date is the 'AMERICAN'. To be true, if i try :

Code: Select all

select TO_DATE('24/2/2010 11:52:55 AM', 'fmDDfm/fmMMfm/YYYY fmHH12fm:MI:SS AM') from dual
it works.

The nls_date_language=GREEK parameter, sets the default language for the database and then the πμ/μμ are immediately recognized and everything works.

I can't seem to find any reason for what you say you encounter in your tests. I would ask you to change the generated query accordingly and if someone else, from an other country maybe, questions this, then we discuss about it again. For now, it seems that we are the only ones that requested this feature in the first place, and still no one else in this forum commented otherwise.
by crazypit
Thu 09 Dec 2010 13:43
Forum: dotConnect for Oracle
Topic: Memory Error with latest version
Replies: 15
Views: 2972

It seems to work ok now.Thanks.
by crazypit
Thu 09 Dec 2010 13:42
Forum: dotConnect for Oracle
Topic: InvalidCastException in latest Beta version
Replies: 12
Views: 2751

It seems to work ok now. Thanks.
by crazypit
Thu 09 Dec 2010 08:17
Forum: LinqConnect (LINQ to SQL support)
Topic: Support for IFormatProvider parameter in Convert.ToDateTime
Replies: 23
Views: 7091

Now, it is getting really odd....

Running both queries through SQL* Plus tool of my Oracle Instant Client, BOTH queries are eligible.

I think, this needs to be solved with Oracle support.

In any case, using the Greek format meridian characters in a format string, seems rather off to me. I really think that the general format placeholder should be enough.
by crazypit
Tue 07 Dec 2010 13:14
Forum: LinqConnect (LINQ to SQL support)
Topic: Support for IFormatProvider parameter in Convert.ToDateTime
Replies: 23
Views: 7091

Well, that is surely odd!

My session parameters are:

PARAMETER VALUE
1 NLS_LANGUAGE AMERICAN
2 NLS_TERRITORY AMERICA
3 NLS_CURRENCY $
4 NLS_ISO_CURRENCY AMERICA
5 NLS_NUMERIC_CHARACTERS .,
6 NLS_CALENDAR GREGORIAN
7 NLS_DATE_FORMAT DD-MON-RR
8 NLS_DATE_LANGUAGE AMERICAN
9 NLS_SORT BINARY
10 NLS_TIME_FORMAT HH.MI.SSXFF AM
11 NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
12 NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
13 NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
14 NLS_DUAL_CURRENCY $
15 NLS_COMP BINARY
16 NLS_LENGTH_SEMANTICS BYTE
17 NLS_NCHAR_CONV_EXCP FALSE


My database parameters are:

PARAMETER VALUE
1 NLS_LANGUAGE AMERICAN
2 NLS_TERRITORY AMERICA
3 NLS_CURRENCY $
4 NLS_ISO_CURRENCY AMERICA
5 NLS_NUMERIC_CHARACTERS .,
6 NLS_CHARACTERSET EL8ISO8859P7
7 NLS_CALENDAR GREGORIAN
8 NLS_DATE_FORMAT DD-MON-RR
9 NLS_DATE_LANGUAGE AMERICAN
10 NLS_SORT BINARY
11 NLS_TIME_FORMAT HH.MI.SSXFF AM
12 NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
13 NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
14 NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
15 NLS_DUAL_CURRENCY $
16 NLS_COMP BINARY
17 NLS_LENGTH_SEMANTICS BYTE
18 NLS_NCHAR_CONV_EXCP FALSE
19 NLS_NCHAR_CHARACTERSET AL16UTF16
20 NLS_RDBMS_VERSION 11.2.0.1.0

Essentially, only the Character Set is changed from the default configuration of the setup. It is changed to EL8ISO8859P7 which is the Greek ISO character set. Session parameters are never changed. Oracle Instant Client 11.2.0.1 is used, no Direct mode. DB is Oracle 11.2.0.1. No special parameters in the connection string are used except from the usual ones.
by crazypit
Fri 03 Dec 2010 07:47
Forum: LinqConnect (LINQ to SQL support)
Topic: Support for IFormatProvider parameter in Convert.ToDateTime
Replies: 23
Views: 7091

The exact opposite is correct. A Format string with "AM, PM" should be generated from the LINQ expression and not the Greek equivalent "πμ, μμ". If i run the query :

Code: Select all

select TO_DATE('24/2/2010 11:52:55 πμ', 'fmDDfm/fmMMfm/YYYY fmHH12fm:MI:SS πμ', 'NLS_DATE_LANGUAGE = GREEK') from dual
in my Oracle 11.2.0.1 system , i get a :
ORA-01821: date format not recognized

If i run a :

Code: Select all

select TO_DATE('24/2/2010 11:52:55 πμ', 'fmDDfm/fmMMfm/YYYY fmHH12fm:MI:SS PM', 'NLS_DATE_LANGUAGE = GREEK') from dual;
everything works as expected. In fact, it sones not matter at all if "AM" or "PM" is used. The correct string representation is returned according to the "πμ" defined in the date. The "AM", "PM" is just a placeholder which says that the supplied date does not end at the Second but also has the PM, AM indicator.

So, it is not a matter of LINQ exception. It justs generates wrong SQL.

Quoting from the relevant Oracle documentation:

TO_DATE(, [ format_mask ], [ nls_language ])
string1 is the string that will be converted to a date.

The format_mask parameter is optional. It is the format that will be used to convert string1 to a date.

nls_language is optional. The nls_language parameter sets the default language of the database. This language is used for messages, day and month names, symbols for AD, BC, a.m., and p.m., and the default sorting mechanism. This parameter also determines the default values of the parameters NLS_DATE_LANGUAGE and NLS_SORT.

The following table shows options for the format_mask parameter. These parameters can be used in various combinations.

Parameter Explanation
YEAR Year, spelled out alphabetically
YYYY 4-digit year
YYY
YY
Y Last 3, 2, or 1 digit(s) of year.
IYY
IY
I Last 3, 2, or 1 digit(s) of ISO year.
IYYY 4-digit year based on the ISO standard
RRRR Accepts a 2-digit year and returns a 4-digit year.
A value between 0-49 will return a 20xx year.
A value between 50-99 will return a 19xx year.
Q Quarter of year (1, 2, 3, 4; JAN-MAR = 1).
MM Month (01-12; JAN = 01).
MON Abbreviated name of the month.
MONTH The name of month, padded with blanks to length of 9 characters.
RM Roman numeral month (I-XII; JAN = I).
WW The week of the year (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year.
W The week of the month (1-5) where week 1 starts on the first day of the month and ends on the seventh.
IW The week of year (1-52 or 1-53) based on the ISO standard.
D Day of the week (1-7). Sunday is day 1 when nls_territory is set to 'AMERICA' but differs if another nls_territory is set (i.e. 'UNITED KINGDOM' or 'GERMANY' - in these cases Monday is 1.
DAY Name of the day.
DD The day of month (1-31).
DDD The day of year (1-366).
DY Abbreviated name of the day. (Mon, Tue, Wed, etc)
J Julian day; the number of days since January 1, 4712 BC.
HH Hour of day (1-12).
HH12 Hour of day (1-12).
HH24 Hour of day (0-23).
MI Minute (0-59).
SS Second (0-59).
SSSSS Number of seconds past midnight (0-86399).
FF Fractional seconds. Use a value from 1 to 9 after FF to indicate the number of digits in the fractional seconds. For example, 'FF5'.
AM, A.M., PM, or P.M. Meridian indicator
AD or A.D AD indicator
BC or B.C. BC indicator
TZD Daylight savings identifier. For example, 'PST'
TZH Time zone hour.
TZM Time zone minute.
TZR Time zone region.

So, the Meridian indicator and all the format strings, are predefined! No greek representations are valid!
by crazypit
Wed 01 Dec 2010 14:41
Forum: LinqConnect (LINQ to SQL support)
Topic: Support for IFormatProvider parameter in Convert.ToDateTime
Replies: 23
Views: 7091

Hello,

I never tested the functionality until now. Using the latest 6.00.58 version i still get an error. The generated query is like this:

select TO_DATE('24/2/2010 11:52:55 πμ'), 'fmDDfm/fmMMfm/YYYY fmHH12fm:MI:SS πμ', 'NLS_DATE_LANGUAGE = GREEK')
from dual

where the Greek AM PM indicator is used in the format string! This is wrong as 'πμ' or 'μμ' are not valid Oracle format characters. You should generate something like this:

select TO_DATE('24/2/2010 11:52:55 πμ'), 'fmDDfm/fmMMfm/YYYY fmHH12fm:MI:SS AM', 'NLS_DATE_LANGUAGE = GREEK')
from dual

where the AM or PM format character is used along with the nls lang parameter.
by crazypit
Tue 30 Nov 2010 09:57
Forum: dotConnect for Oracle
Topic: InvalidCastException in latest Beta version
Replies: 12
Views: 2751

Does the latest 6.00.58 version, fix the issue?
by crazypit
Fri 26 Nov 2010 11:34
Forum: dotConnect for Oracle
Topic: InvalidCastException in latest Beta version
Replies: 12
Views: 2751

I sent you a test project that replicates the problem along with the SQL DDL statement that create the 3 Tables for the relevant compiled query. Nevetheless, i'm still eager to get the customized 5.70.190 build.