Search found 43 matches

by [email protected]
Thu 28 May 2009 14:55
Forum: dotConnect for MySQL
Topic: LoadOptions cannot be changed
Replies: 16
Views: 5823

You say, the current build has a problem with the LoadWith method. I also detected a problem with it. Could you have a look at it and tell me if this is the same problem as you mentioned or if I found another bug?

I have the following linq statment:

Code: Select all

var recordSet = (from m in PPCustomer.Mailings.LoadWith(m => m.MailingRecipients.LoadWith(mr => mr.MailingDownloads.LoadWith(md => md.Mailing2Asset))).LoadWith(m => m.User)
							 join mr in PPCustomer.MailingRecipients on m.MailingId equals mr.MailingId
							 join sq in PPCustomer.MailingDownloads on mr.MailingRecipientId equals sq.MailingRecipientId into lj
							 from md in lj.DefaultIfEmpty()
							 join sq2 in PPCustomer.Mailing2Assets on m.MailingId equals sq2.MailingId into lj2
							 from ma in lj2.DefaultIfEmpty()
							 where m.MailingId == mailingId
								&& ((mr.MailingRecipientId == mailingRecipientId && m.Password == password)
									|| mr.UserId == CoreInfo.User.UserId
									|| editAllMailings)
							 select new { Mailing = m, Mailing2Asset = ma }).Distinct(); 

var mailing = recordSet.First().Mailing;
This code generates the following SQL statements:

Code: Select all

SELECT DISTINCT t1.`MailingId`, t1.`State`, t1.`CreationDate`, t1.`CreatedByUserId`, t1.`Subject`, t1.`Message`, t1.`Password`, t1.`ExpirationDate`, t1.ts, t4.`Mailing2AssetId`, t4.`MailingId` AS MailingId1, t4.`AssetId`, t4.`ImageFormatId`, t4.`LanguageVersion`, t4.ts AS ts1
FROM tbl_mailings t1
INNER JOIN tbl_mailing_recipients t2 ON t1.`MailingId` = t2.`MailingId`
LEFT OUTER JOIN tbl_mailing_downloads t3 ON t2.`MailingRecipientId` = t3.`MailingRecipientId`
LEFT OUTER JOIN tbl_mailings2assets t4 ON t1.`MailingId` = t4.`MailingId`
WHERE (t1.`MailingId` = :p0) AND (((t2.`MailingRecipientId` IS NULL) AND (t1.`Password` IS NULL)) OR (t2.`UserId` = :p1) OR :p2) LIMIT 1
ParameterName = p0
DbType = Int32
Value = 153
ParameterName = p1
DbType = Int32
Value = 2
ParameterName = p2
DbType = Int64
Value = True

SELECT t1.`MailingRecipientId`, t1.`MailingId`, t1.`UserId`, t1.`EmailAddress`, t1.`RecipientType`, t1.`ReadReceiptTime`, t1.ts, t3.`MailingDownloadId`, t3.`MailingRecipientId` AS MailingRecipientId1, t3.`Mailing2AssetId`, t3.`DownloadTime`, t3.ts AS ts1
FROM (
    SELECT t2.`MailingRecipientId`, t2.`MailingId`, t2.`UserId`, t2.`EmailAddress`, t2.`RecipientType`, t2.`ReadReceiptTime`, t2.ts
    FROM tbl_mailing_recipients t2
    WHERE :np0 = t2.`MailingId`
    ) t1
LEFT OUTER JOIN tbl_mailing_downloads t3 ON t1.`MailingRecipientId` = t3.`MailingRecipientId`
ORDER BY t1.`MailingRecipientId`
ParameterName = np0
DbType = Int32
Value = 153

SELECT t1.UserId, t1.Lastname, t1.Firstname, t1.Tel, t1.Company, t1.Street, t1.Address2, t1.Zip, t1.City, t1.Country, t1.Password, t1.Department, t1.CreationDate, t1.LastLogin, t1.InvalidLoginAttempts, t1.ExpirationDate, t1.EmailAddress, t1.Language, t1.AllowUpdate, t1.UseLDAP, t1.LoginOnlyWithSecurityToken, t1.hideIconShowMore, t1.InternalContactUserId, t1.Comment, t1.State, t1.CDF1, t1.CDF2, t1.CDF3
FROM tbl_users t1
WHERE :np0 = t1.UserId
ParameterName = np0
DbType = Int32
Value = 2
You'll quickly see that the LoadWith "MailingRecipients", the LoadWith "MailingDownloads" and the LoadWith "User" works. But the LoadWith "Mailing2Asset" does not work.

Any idea?
________
Growing marijuana
by [email protected]
Thu 28 May 2009 11:02
Forum: dotConnect for MySQL
Topic: LoadOptions cannot be changed
Replies: 16
Views: 5823

This does not work.

m.MailingRecipients does not expose a LoadWith method because it's not a Devart.Data.Linq.Table but a Devart.Data.Linq.EntitySet.

Any other suggestions?
________
ANGELINA JOLIE PIC
by [email protected]
Wed 27 May 2009 16:20
Forum: dotConnect for MySQL
Topic: LoadOptions cannot be changed
Replies: 16
Views: 5823

Hello

There's something I don't understand exactly with the LoadWith method. With the first LoadWith statement I load the first level children (=MailingRecipients), which works fine. But then I also try to load the children of the MailingRecipients (=MailingDownloads). But this seems not to work. How do I have to apply the LoadWith method to achieve this:

Code: Select all

from m in PPCustomer.Mailings.LoadWith(m => m.MailingRecipients)
join mr in PPCustomer.MailingRecipients.LoadWith(mr => mr.MailingDownloads) on m.MailingId equals mr.MailingId
select m
Thank you & best regards
________
No2 vaporizer reviews
by [email protected]
Tue 26 May 2009 15:22
Forum: LinqConnect (LINQ to SQL support)
Topic: How to generate case insensitive LIKE comparision with LINQ?
Replies: 22
Views: 27837

How to generate case insensitive LIKE comparision with LINQ?

Hello

The following LINQ statement...

Code: Select all

 (from m in PPCustomer.Mailings
where m.Subject.Contains("test") 
select m).Count();
creates this SQL code:

Code: Select all

SELECT COUNT(*) AS C1
FROM tbl_mailings t1
WHERE  BINARY t1.`Subject` LIKE '%test%'
How is it possible to generate SQL code without the BINARY keyword in order to enable case insensitive search.. like this:

Code: Select all

SELECT COUNT(*) AS C1
FROM tbl_mailings t1
WHERE  t1.`Subject` LIKE '%test%'
My suggestion would be this..

Code: Select all

 (from m in PPCustomer.Mailings
where m.Subject.Contains("test", StringComparer.CurrentCultureIgnoreCase) 
select m).Count();
but unfortunately it's not possible to pass a StringComparer to the Contains() method. Any ideas?

Best regards
________
VFR800
by [email protected]
Tue 26 May 2009 13:24
Forum: LinqConnect (LINQ to SQL support)
Topic: Wrong evaluation of && and || operator in LINQ queri
Replies: 2
Views: 2678

Yes, the Contains method throws an exception if the argument is null. But anyway... if the || operator would work as expected (short-circuit evaluation) the Contains method wouldn't be evaluated and therefore wouldn't throw an exception.
http://msdn.microsoft.com/en-us/library ... S.80).aspx

best regards
________
TRICHOMES
by [email protected]
Tue 26 May 2009 10:14
Forum: LinqConnect (LINQ to SQL support)
Topic: Wrong evaluation of && and || operator in LINQ queri
Replies: 2
Views: 2678

Wrong evaluation of && and || operator in LINQ queri

Hello

I am using the || (OR) operator in the where clause of a LINQ statement. If the first oparand evaluates to true, the second operand shouldn't be evaluated as in the following example...

Code: Select all

			string searchString = null;

			if (true || "test".Contains(searchString))
				searchString = "";
within this LINQ statement this rule does not work anymore... the second operand is evaluated anyway and throws an exception...

Code: Select all

			string searchString = null;
			var recordSet = (from m in PPCustomer.Mailings
							 where String.IsNullOrEmpty(searchString) || m.Subject.Contains(searchString)
							 select m);
Can you confirm, this is a bug?

Best regards
________
Subaru R1 Specifications
by [email protected]
Tue 26 May 2009 06:52
Forum: dotConnect for MySQL
Topic: DBMonitor not working properly
Replies: 3
Views: 3479

Is it possible that DBMonitor does not support complex queries?

I just found out that monitoring of this statement is working:

Code: Select all

var recordSet = (from m in PPCustomer.Mailings
                         select m);

int totalMailings = recordSet.Count();
but this one is not working...

Code: Select all

var recordSet = (from m in PPCustomer.Mailings
                         join mr in PPCustomer.MailingRecipients on m.MailingId equals mr.MailingId
                         select m);

int totalMailings = recordSet.Count();
________
Maine Dispensaries
by [email protected]
Tue 26 May 2009 06:30
Forum: dotConnect for MySQL
Topic: DBMonitor not working properly
Replies: 3
Views: 3479

DBMonitor not working properly

Hello

I am developing ASP.NET applications with the ASP.NET Development Server (not with IIS) and I'd like to monitor my LINQ statements. Unfortunately the monitoring with the DBMonitor is very unreliable. Sometimes it traces some SQL statements and sometimes nothing is traced. Sometimes the monitoring works only after many trials.

Right now I have a problem where I can try as much as I want, but nothing will ever be monitored. I ensured to start DBMonitor first and then start the debug session of my Visual Studio where I instantiate MySQLMonitor and set the IsActive property to true.

Is there anything I can do about this? Are there other (more reliable) ways to monitor the generated SQL statements of my LINQ statements?

Best regards

PS: Maybe monitoring is the wrong approach. When developing Microsoft LINQ, I use LINQPad (www.linqpad.net) to debug my linq statements. This tool is absolutely great. You should contact them and encourage them to implementyour MySQL LINQ provider.
________
Brunette schoolgirl
by [email protected]
Wed 20 May 2009 14:48
Forum: dotConnect for MySQL
Topic: LoadOptions cannot be changed
Replies: 16
Views: 5823

Hello

I embedded the new version. But now I get the exception "The query operator 'LoadWith' is not supported" when calling the Single() statement (last line) in the following code block:

Code: Select all

var recordSet = from l in PPCustomer.LoginInfos.LoadWith(l => l.LoginInfoHistories)
where l.CookieGuid == guid.ToString()
select l;

return recordSet.Single();
Before I migrated to the new version, my code looked like this...

Code: Select all

var recordSet = from l in PPCustomer.LoginInfos.Include(l => l.LoginInfoHistories)
where l.CookieGuid == guid.ToString()
select l;

return recordSet.Single();
.. and was perfectly working (the only thing which changed was "Include" to "LoadWith")..


Do I have to change anything or is this a bug with the LoadWith method?
________
CYPRUS COOKING
by [email protected]
Tue 05 May 2009 12:38
Forum: dotConnect for MySQL
Topic: LoadOptions cannot be changed
Replies: 16
Views: 5823

Wow... that's great! Good job!

So what's the difference between Devart's Table.LoadWith(Expression) and Table.Include(Expression)? Both methods seem to work on table-level.
________
Homemade Vaporizers
by [email protected]
Tue 05 May 2009 09:48
Forum: dotConnect for MySQL
Topic: LoadOptions cannot be changed
Replies: 16
Views: 5823

thank you. that's very interesting. it seems this is something which the microsoft linq implementation for MS SQL does not have. or is there something similar?
________
Chrysler Sohc V6 Engine Specifications
by [email protected]
Fri 24 Apr 2009 06:46
Forum: dotConnect for MySQL
Topic: LoadOptions cannot be changed
Replies: 16
Views: 5823

LoadOptions cannot be changed

Hello

I am deleting some entries from a table:

Code: Select all

Customer.LoginInfos.DeleteAllOnSubmit(Customer.LoginInfos.Where(l => l.LoginTime.AddDays(days) (l => l.LoginInfoHistories);
Customer.LoadOptions = dataLoadOptions;

var recordSet = from l in Customer.LoginInfos				select l;
Customer.LoadOptions is null. When I try to assign my dataLoadOptions, I get the exception "LoadOptions cannot be changed". The stack trace is just:
at Devart.Data.Linq.DataContext.set_LoadOptions(DataLoadOptions value)

If I omit the delete statement, I can assign the load options. It seems that once the Customer datacontext is initialized, I cannot change the load options anymore. this is a pitty because I'd like to initialize the datacontext only once and then use different load options when ever I execute a query.
________
Dodge hemi small block
by [email protected]
Wed 22 Apr 2009 15:31
Forum: dotConnect for MySQL
Topic: Lost connection to MySQL server during query
Replies: 23
Views: 14457

Hello

1. The value of wait_timeout is 28800
2. It seems, the error occurs in the DbSessionStateStore. I forgot to mention, that the sessions are stored in the MySQL db through your session state provider:

Code: Select all

[MySqlException (0x80004005): Lost connection to MySQL server during query]
   Devart.Common.Web.Providers.DbSessionStateStore.a(Boolean A_0, HttpContext A_1, String A_2, Boolean& A_3, TimeSpan& A_4, Object& A_5, SessionStateActions& A_6) +3114
   Devart.Common.Web.Providers.DbSessionStateStore.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags) +57
   System.Web.SessionState.SessionStateModule.GetSessionStateItem() +117
   System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +487
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +66
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Do you think, this already helps to identify the problem? By the way... I don't use an own implementation of your MySqlConnection object. I just use the "Devart.Data.Linq.DataContext(string connectionString)" overload when working with LINQ.

Best regards
by [email protected]
Tue 21 Apr 2009 07:41
Forum: dotConnect for MySQL
Topic: Lost connection to MySQL server during query
Replies: 23
Views: 14457

Lost connection to MySQL server during query

Hello

I am using dotConnect for MySQL in my ASP.NET application. When loading a webpage, I am performing some SQL LINQ statements. If I wait a very long time and make a refresh of the site, dotConnect generates the following exception if it tries to execute the SQL LINQ statements again:

Lost connection to MySQL server during query.

Why does this happen? How can I prevent this? I guess somehow the application still holds a reference to the connection which has been timed out. Shouldn't dotConnect open a new connection in this case?

Thanks and regards
________
by [email protected]
Tue 14 Apr 2009 13:59
Forum: LinqConnect (LINQ to SQL support)
Topic: Still a bug with the table.Attach method :-(
Replies: 3
Views: 2689

Ok, sorry. I tested this with an entity which didn't change at all. Therefore dotConnect didn't generate an UPDATE statement. If I attach a changed entity everything seems to work now.
________
Marriage Advice Dicussion