|
|
January 2007 - Posts
-
Hello! I have an ASP.NET app. where I use DLINQ. I want to find out the best way of using DataContext because perfomance is a critical thing. I have these variants: 1) DataContext will be initialized only once and placed into the Session. (But my DB structure is quite big) 2) DataContext will be initialized every time when a query executes. 3)... Please tell me your suggestions. Read More...
|
-
Hello guys, I just installed orcas CTP Jan2007 and things seem to work fine .... but I do not find any trace of Linq. I went to add a refrence, there is no system.data.linq dll :-( I had installed the Linq may 2006 preview on VS 2005, and there it was, but now in orcas... nothing. Isn't this installed with orcas? And if so, then what use for orcas ;-) Thanks a lot for any feedback - I am so excited to start working with Linq... Regards, Fabian Read More...
|
-
Since LINQ is a new project I don't think this question has been asnwered anywhere yet - what will be an appropriate use of it, especially in multi-tiered environmnet? What applications or scenarios will be especially benefitical for LINQ? I played with BLINQ - very impressive. It would have been much harder to do this kind of app by pulling the data from SQL system catalog... Are there any examples like that? Any architecture guidance coming up? Thanks, -Stan Read More...
|
-
While using this new inline initialization thing a local variable will be called something like _tampa_f__1 example: 134 return new Literal { Value }; The question is, where did the generated name prefix "tampa" come from? :) Is it a river? Read More...
|
-
Hi, I'd like to be able to set a DataContext's connection string at run-time, rather than referring to an application setting (I'd use a connection string from web.config). I haven't been able to find any information on the DesignConnection property, and when I remove it, an error informs me that "No overload for method 'DataContext' takes '0' arguments". How would I accomplish this? Thanks, Dan Finch Read More...
|
-
In future version of LINQ will I be able to do a .ForEach directly on the Dlinq objects? For example: var batches = from b in this.m_Database.Batches where b.EndTime == null select b; batches.ForEach(b => b.EndTime = DateTime.Now); Also will there be any other CTPs of Linq for Visual Studio 2005, or will I have to download the entire Orcas CTP if I want to use the newest features? Thanks. Read More...
|
-
We are pleased to note that XSLT 2.0 and XPath 2.0 are now W3C Recommendations . Microsoft contributed thousands of person-hours to the W3C efforts that developed these standards and is committed assist with the further development of XML standards at W3C. XSLT / XPath 2.0 offer nice improvements over 1.0 in several ways, including an ability to leverage schema-defined datatypes, support for regular expressions, support for user-defined functions, and especially a much easier way to aggregate results Read More...
|
-
Is there available sample of implementation of Linq interfaces for own data storage? Read More...
|
-
I've just installed the may linq download, but I have an issue trying to use it. The IDE picks everything up OK, intellisense works fine. But when I try to comile I get errors all over the place, except for in downloaded examples where I use the project file for the download. I've figured out where the issue lies: <Import Project="$(ProgramFiles)\LINQ Preview\Misc\Linq.targets" /> The above had to be included in the csproj file for the compiler to work, what I can't figure out is Read More...
|
-
I am playing with Wes Dyers' excellent Memoization Function applied on Fibonacci function and I think the Memoize extension function is not correctly executed on a method argument. More precisely the following code: using System; using System.Collections.Generic; using System.Linq; namespace Fibonacci { static class Program { public static Func <A, R> Memoize<A, R>( this Func <A, R> f) { var map = new Dictionary <A, R>(); return a => { R value; if (map.TryGetValue(a, out Read More...
|
-
After use SubmitChanges() in my Sql Server 2000 database, the application fails and show the next exception: Unhandled Exception: System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Transaction'. How can i do to resolve this problem. I use Sql Server 2000 and Windows XP Service Pack 2 Thanks. Read More...
|
-
In Web Site Project: Using LINQ over DataSet I am receiving following error message while trying to use ToQueryable over Dataset. Unable to cast object of type 'System.Data.DataTable' to type 'System.Collections.IEnumerable'. in code lines Dim Person = PersonDataset.Tables"Person").ToQueryable() Dim AD = ADEmailDataSet.Tables("ADTable").ToQueryable() Here are my imports: Imports System.DirectoryServices Imports System.DirectoryServices.ActiveDirectory Imports System.Data.SqlClient Read More...
|
-
Hi, is it possible to implement associations between objects without using the EntitySet/EntityRef types? I would like to model my business domain objects without any reference to ORM, LINQ, databases and the like. So if I have a customer objects with a list of orders I would like to have an IList<Order> property on my customer and map that as an association. Is that possible with LINQ to SQL? Is it possible with LINQ to Entities? Sincerely, Stefan Read More...
|
-
I have installed BLINQ, and when running it, I get the "Failed to access IIS metabase" error message. I posted my error message and stack trace in another newsgroup and someone there told me that I have conflicting versions of ASP.NET installed and that one is a beta. The only thing I can think of that could have possibly done that is either BLINQ or LINQ. Does installing BLINQ install a beta version of ASP.NET? Does the May 2006 LINQ CTP install an ASP.NET beta? I don't get why this isn't Read More...
|
-
First, I'm pretty ignorant on the internals of LINQ, so I've been searching around regarding this, and not found anything so far. Since it seems for LINQ to work with a collection, all it needs is to implement IEnumerable, then I was wondering if that means LINQ uses sequential search when evaluating queries on a collection? Is it possible that the concrete implementation of IQueryable can be written for each collection type to specifically exploit better search algorithms such as binary search or Read More...
|
-
Hi, I found interesting trick that makes it possible to cast anonymous type returned as object from method back to the original anonymous type (without using the slow reflection), so I thought I could share it here (it works only with the latest "Orcas" CTP, because behavior of May CTP compiler is slightly different). // Method that returns anonymous type as object object ReturnAnonymous() { return new { City = "Prague" , Name = "Tomas" }; } void Main() { // Get instance Read More...
|
-
Hi, Where I can download the January CTP of DLink ? Regards, Alexnaldo Santos Read More...
|
-
Ok, am I missing something? I can't find any specific information regarding this but I am attempting to use LINQ in the January CTP with VB.NET. It works fine int he May CTP and it works fine in the January CTP when using C#. I have added the appropriate reference to System.Core but it doesn't recognize the query syntax. None of the documentation states that the new LINQ support is for C# only. Can anyone tell me what i'm missing or if there is no support for VB.NET yet? Thanks Read More...
|
-
I have the following code: var q = from m in db.Vms select m; which compiles and runs as expected. However as soon as I introduce a where clause, e.g. var q = from m in db.Vms where m.VmName.Contains( "tttt" ) select m; I get the following error: The type arguments for method 'System.Data.TypedTableBaseExtensions.Where<T>(System.Data.TypedTableBase<T>, System.Query.Func<T,bool>)' cannot be inferred from the usage. Try specifying the type arguments explicitly. All of the Read More...
|
-
i.e. Expression<Func<string, bool>> linq = s => s.Contains ("LINQ"); Expression<Func<string, bool>> oracs = s => s.Contains ("ORCAS"); Expression<Func<string, bool>> either = s => linq (s) || orcas (s); This has been mentioned before, but I'd like to reiterate it since it's not in the Jan CTP :) This feature is quite important. Without it, LINQ to SQL queries are only partly composable. Thanks Joe Read More...
|
-
Jan CTP looks terrific. Great to see LINQ expressions in Orcas. Could I repeat a request for IGrouping "classic", i.e. public interface IGrouping : IEnumerable { object Key { get; } } public interface IGrouping<K, T> : IEnumerable<T> , IGrouping { K Key { get; } } Otherwise, please post the code of a method that accepts any IGrouping, and writes its Key property. (If you can do that without feeling dirty, I withdraw the request ;) Read More...
|
-
And make the properties and methods virtual of course. I've previously created a code-generation system that works in a remarkably similar way to the code-generation in Linq-to-Sql, a good example of convergent evolution. Much of it was written before the first Linq CTP was out, and it's been in commercial use for over a year now, very successfully. I've now left the company I wrote that for and I've set up on my own. I'm writing a new version of the system for my own company, and I'm basing it on Read More...
|
-
I notice UnmappedType now calls InheritanceRules.DistinguishedMemberName which eliminates some of the bugs in the May release; however it still falls back on using MemberInfo.MetadataToken which could be BAD. MemberInfo.MetadataToken is not unique across assemblies. The May CTP's use of MetadataToken meant that subclassing a type defined in a different assembly *might* cause LINQ to SQL to crash when projecting into the type. It took nearly a day to track this down. I presume this bug is still possible Read More...
|
-
A question regarding LINQ to SQL in the January Orcas CTP. DataContext.GetTable is now internal - what method should we use instead? For now I'm calling GetTable via reflection which works fine but is a bit messy. I notice a number of LINQ to SQL bugs have been fixed which is great. Thanks Joe Read More...
|
-
I've tried just about everything, I get this error when I create a Dling object: Warning 1 The custom tool 'MSDLinqGenerator' failed. Could not load file or assembly 'Microsoft.VisualStudio.Modeling.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. C:\Program Files\Microsoft SDKs\ADO.NET vNext CTP\Samples\CSharp\LINQLibrary1\DLinqObjects1.dlinq LINQLibrary1 I'm unable to use DLinq Read More...
|
-
I was just doing some reading, and I find that the Association IsParent property's name is a little confusing as to which entity class, source or target, it is pertaining to. ThisKey and OtherKey are fairly clear, but the IsParent is not. Since it applies to the target class, renaming it to OtherIsParent would be more intuitive. Thanks. Read More...
|
-
Nice work, the CTP - a tad flaky, but usable. I am in the process of upgrading one of my projects using LINQ to the May CTP. I managed to get the build process running, found the "missing" DLL's. I am now stuck with basically 5 compiler errors all related to extension methods. DLL's included are: System.Core; namespaces used are: System; System.Collections.Generic; System.Linq.Expressions; System.Linq; System.Text; System.Xml; The compiler chokes on: public IEnumerable < object > Read More...
|
-
Hi can anyone explain how DLinq determines the order that where clauses appear in the SQL that is generated. I was under the impression that the order in which clauses are placed can have a real effect on the speed at which records are filtered and returned. For example if I select a record that is mapped to another table and then take the IQueryable result and say .Where(x=>x.blah == blah) then the primary key of the second table appears to be placed after the where blah = blah in the SQL. Is Read More...
|
-
Hi All, Please forgive if this has been already answered. string[] words = { "cherry", "apple", "blueberry" }; var wordsWithA = words.Where(word => word[0] == 'a'); //The above works fine var wordsWithA2 = from word in words where( w => w[0] == 'a') select word; //The above gives compiler error: Func<string, bool> whereFunc = w => w[0] == 'a'; var wordsWithA3 = from word in words where( whereFunc(word) ) select word; //The above works fine What am I missing?? Read More...
|
-
Will it be possible to project into an anonymous type and cause that type to be cast to an interface? I know this question was asked some time ago (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=127275&SiteID=1), but I wanted to bring it up again to see what the thinking is on this point... Read More...
|
-
I assume the answer to this is going to be the same answer as I received in this post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1106156&SiteID=1 But, I want to be sure. If I add an entity to a table, I can't retrieve that entity back out until I call SubmitChanges(). Here is an example: Northwind db = new Northwind(@"Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=SSPI;"); db.Customers.Add( new Customer { CustomerID = "LAWN", CompanyName Read More...
|
-
How can I take maximum throughout the table? This statement can not be compiled: var q = from nb in App .Db.Numbers select new { Value = nb.Max(md1 => md1.Value) }; Read More...
|
-
Was going through alot of threads, but i didnt see any concrete answer to my question. I am about to start development on a server where we in the future would like to use LINQ. Would it be advisable to start using the LINQ may CTP? or are many things destined to change so we would have been just as good, if not better off going with ADO.NET untill the final release of LINQ is available, and then rewrite it to use LINQ? Read More...
|
-
Ralf Lämmel, who is the man behind LINQ to XSD , has a couple of new papers on his site that I have not seen up until now. The first paper is on Function OO Programming and the second is on XML Steaming. I've only skimmed each but they're bound to be interesting to anyone interested in functional programming, streaming XML API's, and LINQ. API-based XML streaming with FLWOR power and functional updates Functional OO Programming with Triangular Circles You can also find a bunch of other interesting Read More...
|
-
Hello, Just looking at using Linq to SQL (Dlinq) in my final year disseration as it has some really interesting points for me to talk about. I was trying to create a database file (sorry, not sure what the true terminology is) using either the DLinq designer or SQLMetal but I can't seem to find it in the CTP. Will I have to wait until the Feb CTP or use the old May CTP to access this? Or am I just missing something? Thanks for your time. Ben Read More...
|
-
Hi, Is there any special reason for not including a "raise to power" expression type in the expression tree API? VB has such an operator, for instance... Here I show a situation where having such an operator would be desirable: http://www.elguille.info/NET/futuro/firmas_octavio_symbolic_computation_EN.htm Best regards, Octavio Hernandez Madrid, SPAIN Read More...
|
-
I'm trying to install the May CTP on Vista RTM running VS 2005 SP1. The install fails immediately with the following error message: "The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2738." If I run "msiexec /i "LINQ Preview (May 2006).msi" /log log.txt" and log the MSI install, here is the start of the log, with the errors: === Logging started: 1/13/2007 0:55:38 === Action 0:55:38: Read More...
|
-
I am seeing some behavior that looks odd. It has to do with the identity tracking of entity objects versus querying the same object from the database. What I have found is that if I perform a DLINQ query, an entity's membership in the results set is determined by querying the actual database, but if that entity is already in the DataContext cache, the cached object is returned in the results set. This can be odd because the state of that entity in the database may be inconsistent with the state of Read More...
|
-
I have a person object, which has via a foreign key an address table attached to it in the LINQ designer. The address table has an addresstype which comes from a types table via a Foreign Key as well. When I create an instance of a person, and check the first address typeID I get a value of 4. Via my interface I change the value to 6 (a valid value in the types table), I can query the Address object and it will tell me it's set to 6. However, once I commit the changes via DBContext.SubmitChanges() Read More...
|
-
Hi, I have lots of doubts regarding .Net 3.0. I have installed .Net 3.0 final version runtime and vs 2005 extensions nov 2006 ctp. I am developing XBAP applications. After knowing about LINQ I installed linq May 2006 CTP. is this the latest version? Any final version released? In the new project window why i am seeing linq preview and in the right pane I see linq console / linq window app e.t.c is that not possible to use in WPF / XBAP applications? I have mentioned my environment above now when Read More...
|
-
Hi! I have download and installed January Orcas CTP on virtuell server and now I can start Visual Studio Orcas 9.0, but can not find any Linq project to start playing. I am a first timer about Linq. I checked and there is a version 3.5 Net framefork installed under Windows. Regards Read More...
|
-
After having installed the linq preview on a clean installation of vs2005 intellisense was not working. This was due to some registry keys pointing to the wrong paths in the filesystem: HLM\SOFTWARE\Microsoft\LINQ Preview\VCSIDEDIR and HLM\SOFTWARE\Microsoft\LINQ Preview\VCSPKGDIR where both pointing to C:\Program Files\LINQ Preview\" which doesn't seem right. After having changed them to point to C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ and C:\Program Files\Microsoft Visual Studio Read More...
|
-
Hi there, I am investigating DLINQ vs. LINQ for Entities. Reading several posts people say the generated Object Models shall be similar. To be honest the Entity Object Model seems not to be that nice and clean compare to the DLINQ model. And to be honest at the current stage i think DLINQ is much more mature altought it lacks the Flexible Mapping. My suggestion is to enable DLINQ to generate eSQL instead of SQL and name this variant LINQ for EnitySQL. Then we will have mapping and a clean API. What Read More...
|
-
Hi, I have recently been looking through Linq and I've got to say how impressed I am so far. I was recently considering using ruby on rails for a number of projects due to its active record implementation, but this will allow similar benefits in .net. Does any one know of any plans to include ideas such as rails' migration into .net and possibly the Linq project so that database versions can be updated and downgraded using commands and thus making it easier to work with multiple versions. Read More...
|
-
Hi - I installed LINQ Preview (May CTP) on my machine today (LINQ Preview show-up in the Start-Program Files) and when I try to create a project in the New Project dialog, I don't see the 'LINQ Preview' entry at all. Is there something I am missing? Do I need to have .NET Framework 3.0 Runtime for this (I tried this but for some strange reason this installation failed!)? This is what I have on my machine Visual studio 2005 Team System, Windows XP (SP2), .NET Framework 2.0. I have only installed the Read More...
|
-
In the DLINQ Overview for C# document, in the OCCR section, there is an Example 6 on page 67-68 (physical, not Word numbered). In that example, there is a try/catch around the first SubmitChanges() call. In that catch, the code enumerates through the OptimisticConcurrencyException.Conflicts collection. The code then calls the Resolve() method on each Conflict. Then it enumerates through each Conflict's collection of OptimisticConcurrencyMemberConflict objects. If a member conflict object has the Read More...
|
-
Is there (or will there be) any support for limiting a result? Something like var pagedData = from ds in datasource rows 50 to 100 select ds; Regards, Daniel Read More...
|
-
The way property initalizers are now implemented, it is not possible to create classes that are immuatble that also support property initialization. Id like to propose the use of the readonly keyword on properties, which makes the setter accessible only at initialization time, and that readonly fields should also be accessible during initialization time. If the class implements ISupportInitialize (or something like it), then BeginInit/EndInit methods would be wrapped around the initialization. Consider Read More...
|
-
Assuming I am using the code: personBindingSource.DataSource = from p in SPApp.DBContext.Persons orderby p.PersonLast descending select p; How can I programatically select ascending/descending so I don't have to code 2 separate statements? Is there anything I can use in the Query namespace that defines the direction, which I could use as a variable here to specify? I ask because I have at least 10 queries where I need to do this, I'd really hate to make it 20. Read More...
|
-
In DLinq designer walkthrough,the following codes bind the customers table to linq queries: var results = from customers in northwindDataContext1.Customers where customers.City == CityTextBox.Text select customers; customersBindingSource.DataSource = results.ToBindingList(); But I want the associated table "Orders" also can bind to linq queries. var results=from orders in northwindDataContext1.Orders where orders.ShippedDate >=.... select orders ; Read More...
|
-
I noticed standard aggregate functions like sum, avg, count, etc. Is there an extensibility mechanism to implement your own, like in SQL-Server? Thanks Ad. Read More...
|
-
When I run the following code: Northwind db = new Northwind(@"Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=SSPI;"); Customer cust = (from c in db.Customers where c.CustomerID == "LAZYK" select c).Single<Customer>(); cust.Region = "Washington"; Console.WriteLine(db.GetChangeText()); I get these results: UPDATE [Customers] SET [Region] = @p11 FROM [Customers] WHERE ([CompanyName] = @p0) AND ([ContactName] = @p1) AND ([ContactTitle] = @p2) Read More...
|
-
Hi, I'm trying to use the DLINQ designer for tables in SQL Server 2005 that use schemas... so if I drag the table dbo.EXAMPLE.Sample into the designer... nothing happens, nothing on the deisgner, no code. SQLMetal WILL generate the code however. There's a lot of tables in the database, so I don't want to use SQLMetal... it generates everything. If I use a table without schema (eg: dbo.Sample), everything works ok. Anybody hit this problem? Kev Read More...
|
-
Hi, I have created a website using blinq. when i tried to create a new record in my database i got the following error: "The partner transaction manager has disabled its support for remote/network transactions the partner transaction manager has disabled its support for remote/network transactions ” I applied the solution provided on the link: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=230390&SiteID=1 and after that this problem resolved and now I am getting the following error: Read More...
|
-
hi, i notice that SqlMetal does not appear to use Nullable types in the StoredProcedureResult classes it generates. for example, my sql table has a date field that is nullable. i was hoping this would be picked up by SqlMetal and have null values treated as such when displayed in a gridview. instead i get 01/01/0001 in the gridview, which is DateTime.MinValue obviously. am i doing something wrong? when i append a question-mark (for nullable) after the private variable and public property for the Read More...
|
-
Please join us for an hour long public chat on LINQ to SQL and related technologies to be held Tuesday, Dec 12 at 1 PM Pacific time. Follow this link to see your local time for this chat. LINQ is a set of extensions to the .NET Framework that provides native C# language support for querying data. LINQ to SQL is a component of LINQ which allows access to data stored in relational databases. The C# team is actively designing and developing this technology; show up and join the LINQ to SQL team to participate Read More...
|
-
In this post we aim to transform a text file into a hierarchical XML document. As shown in Listing 12.11, the text file will contain the following book information: the ISBN, Title, Author(s), Publisher, Publication Date, and Price. Listing 12.11 CSV of Books 0735621632,CLR via C#,Jeffrey Richter,Microsoft Press,02-22-2006,59.99 0321127420,Patterns Of Enterprise Application Architecture,Martin Fowler,Addison-Wesley Professional,11-05-2002,54.99 0321200683,Enterprise Integration Patterns,Gregor Hohpe,Addison-Wesley Read More...
|
-
In Google Reader this morning, I found an entry in the Programmable Web API feed for DabbleDB . DabbleDB is a "Web 2.0" application that combines "the best of group spreadsheets, custom databases, and intranet application into a new way to manage and share your information on the web." I'm usually pretty skeptical of anything with the "Web 2.0" moniker, however, I'm very interested in new and better ways to present, manage, and integrate data. In addition to providing a very compelling interface Read More...
|
-
I recently upgraded my camera setup and found myself with a very good lens which I will rarely use. Rather than hang onto it I've decided to try and unload it. The lens has gotten very good reviews on Amazon, as well as on a couple third party sites. To see the details of the lens you can checkout the Amazon.com page for the lens. If you have a Canon Digital SLR (Digital Rebel, XT, XTI, 20D, 30D, or 5D) and are looking to get a mid level zoom, drop me a comment or email with an offer. email: steve Read More...
|
-
|
|