Can I stop the dbml designer from adding a connection string to the dbml file? [duplicate]

While in the designer for the DBML, you can right-click on any white-space, and click on Properties (not the same as right-clicking on the DBML file and clicking Properties). From there, expand the “Connection” option. Set “Application Settings” to False and clear out the “Connection String” setting. These settings are what the designer uses to … Read more

Multiple/single instance of Linq to SQL DataContext

Rick Strahl has a nice article about your options: http://www.west-wind.com/weblog/posts/246222.aspx. See also: LINQ to SQL – where does your DataContext live?. You may want a slightly different strategy for each type of deployment – web, desktop, windows service… Summarized, your options are: Global DataContext – dangerous in multi-threaded environments (including web apps). Remember that instance … Read more

LINQ Left Join And Right Join

The example data and output you’ve provided does not demonstrate a left join. If it was a left join your output would look like this (notice how we have 3 results for user 1, i.e. once for each Growth record that user 1 has): User | age| Data |Growth ———————— 1 |2 |43.5 |46.5 1 … Read more

LINQ Where Ignore Accentuation and Case

To ignore case and accents (diacritics) you can first define an extension method like this: public static string RemoveDiacritics(this String s) { String normalizedString = s.Normalize(NormalizationForm.FormD); StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < normalizedString.Length; i++) { Char c = normalizedString[i]; if (CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark) stringBuilder.Append(c); } return stringBuilder.ToString(); } (Modified … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)