|
|
February 2007 - Posts
-
Hi, in May 2006 CTP release I could write a code like this: int[] sequence1 = { 1, 2, 3, 4, 5 }; int[] sequence2 = { 1, 2, 3, 4, 5 }; Console.WriteLine("Are those sequence equal?"); ObjectDumper.Write(sequence1.EqualAll(sequence2) ? "Yes, they are" : "No, they aren't"); With March 2007 Orcas release the EqualAll method seems that is gone. Any idea? Thanks Read More...
|
-
I am working on an application using both WCF and DLinq. As we all know, DLinq is not thread safe. Since DLinq supports lazy-loading, it is more difficult to control when the DLinq will get involved. There always will be more than one threads in WCF application. What is the best way to safely use DLinq? I just wonder why DLinq itself is not thread safe. That is will be a lot easier for programmers. Read More...
|
-
Is there any possibility to customize LINQ to SQL in terms of both query and sql text translation? For query customization it is possible, but what about sql text translation? I hope there is not only one way to do the same thing in LINQ to SQL. Read More...
|
-
Hi, Do I need to create a data object model using sqlmetal in order to use LINQ to sql ?. Currently I am querying Dataset tables by applying ToQueryable(). The reason I am asking this question because using IQueryable interface I am not able to use full functionality of LINQ query syntax for example .ANY doesn't work. Thanks, Rajesh Read More...
|
-
The Community Technology Preview of the next version of the .NET components that the XML team ships is ready for download. It is available in two forms: a self-extracting installer that will setup a version of Visual Studio that can co-exist side by side with VS 2005, and a Virtual PC image . The new stuff includes: XML Tools: XSLT Debugger Enables Input Data Breakpoints allowing the user to break the execution of the style-sheet whenever a certain node in input document is hit. XML Editor Performance Read More...
|
-
-
Generates the following error: Error generating stored procedure 'InsertEmployee'. Unable to get full schema in fo. Exception: Implicit conversion from data type nvarchar to varbinary(max) is not allowed. Use the CONVERT function to run this query. Skipping codegen for stored procedure 'InsertEmployee' due to schema errors. Read More...
|
-
LINQ is a very exciting technology. As of today, I have seen how it can be integrated with ASP.NET. However, I never seen a sample app on how to use Linq with Windows Form controls such as DataGridView and WPF controls. For wpf it has many similarities with ASP.NET web form so I think it is easy to make it work with WPF controls. Any one can point me to some articles or sample applications with regard to windows form control? thanks, bill Read More...
|
-
Hi! I know that it is impossible to load different versions of the .NET Runtime into one Win32 process. We are writing components for a host, that is working with the .NET Framework 3.0 (and therefore .NET Runtime Version 2). Our components should use LINQ. As far as I know LINQ CTP preview is working on the same .NET Runtime version. But what about the final release? Will the final release still operate within an environment that hosts .NET Runtime Version 2? Thx in advance, Jörn Read More...
|
-
I've installed the latest August CTP version and when following the DLinq designer walkthrough I don't see a DLinkObjects template in the add new item dialog. Somehow this is not installed correctly (I also tried a repair but it didn't work). If I create a file with a .dlinq extension it does open up the designer and I can drag tables from the server explorer. Any advice is welcome. Tx, Harry Read More...
|
-
Hi, I am new to LINQ and I just wanted a quick check with you guys on a question that I have but couldn't find answer to it yet. I have a database and I want to make it support SQL. Currently, it has a query language which is SQL-like, but for the future I want to use LINQ or SQL to access it. Is this possible? Regards Read More...
|
-
I am referring to the May 2006 CTP. Am I missing it? Or is it not there? If not, it seems like a necessary feature. Without it, some may be forced into editing the generated code. I see a setting for naming the DataContext. This seems like a natural place to be able to edit the namespace. Thanks. Read More...
|
-
Hi I was a bit puzzled to learn how DLinq handles conditional lookups using the Where-method. As far as I can see only the database state of the objects is considered, and it is thus possible to produce quite unexpected results, if you change the application state of an object: In the small sample below three simple objects are created. Apparantly no objects will be returned from the Table prior to submitting the changes. There are of course good reasons for this, since you would have to check the Read More...
|
-
Hello, I think there may be a DLinq bug for databinding. In my database, the Employee table has a column "AddressID" that is a foreign key reference to "AddressID" column in the Address table which serves as it's primary key. I generated my DataContext class using SqlMetal. When I first designed the UI in order to update this information, I put all of the Employee and Address UI controls on the same form, and used databinding to bind the properties of the entity classes to appropriate controls. When Read More...
|
-
hi, I m using a BindingSource to connect collection of form IQueryable<IMetaData> to controls on a form(IMetaData is interface that i need for a specific reason). IMetaData interface consist of method which returns PropertyInfo [] say Properties. This array provides name of all properties of the class representing a rowtype of a database table. i have a line of code (which i think is cozing a problem ) this.PanelControls [ i ] .DataBindings.Add("Text",BS,Properties [ i ] .Name ); where PanelControls Read More...
|
-
Hello, How would I sub-query the child collection in an including clause to limit the number of child objects that come back. For example, when I do the following: from c in Customers select c).Including(c => (from o in c.Paychecks where (o.OrderDate >= startDate && o.OrderDate <= endDate) select o)); An exception is thrown that states "Including expression must refer to an immediate property". Is there a way to do the above? Read More...
|
-
I have SQL Query: SELECT SUM(decimal_field) AS Summ FROM table_name WHERE (datetime_field BETWEEN '01/01/2006' AND '02/28/2007') So, how can I convert it in DLINQ query? Read More...
|
-
Sorry if this was covered, but I've been searching for a while. Is there a way to update the database schema from dlinq? I use XPO and I just set a property on the connection object to specify if changes that I've made in my object classes will be analyzed and these changes applied to the database schema. What I want is to have the database and its tables created from the code so I don't have to install these on client machines. And when I add a new field have the database automatically update the Read More...
|
-
It would save a lot of typing if we could have the UpdateCheck value in the column attribute defaulted by a UpdateCheckDefault value in the Table attribute. Example - I'd like this: [ Table (Name= "Person" , UpdateCheckDefault= UpdateCheck .Never)] public class Person { [ Column ()] public string FirstName; [ Column ()] public string LastName; [ Column (UpdateCheck= UpdateCheck .WhenChanged)] public string SSN; } instead of this: [ Table (Name= "Person" )] public class Person Read More...
|
-
We have been using the LINQ May 2006 CTP (VS2005) for some time now, and we are very eager to get our hands on the upcoming Orcas March 2007 CTP. However, after reading blog posts and chat transcripts, I've found out that the next Orcas CTP is going to be " on par " with the May 2006 CTP. This sent a cold chill down my spine, since the May CTP is so buggy that we cannot use it for even the most simple tasks... Will the Orcas March CTP include lots of DLINQ bugfixes, or just the codebase from May Read More...
|
-
I have a table Platform with an identity column called PLFID. The DLinq designer generated code correctly attributed this column as Id=True, AutoGen=True. For some rows I need to be able to force a value for the PLFID column, but DLinq won't let me. Either it overwrites it with the @@IDENTITY value, or throws an Exception that I'm not allowed to assign a value to this column. Here is my example code: Platform platform = new Platform (); ...populated the other columns dbContext.Platform.Add(platform); Read More...
|
-
Say you have a query like below: var q = from c in ctx.Contact select c; foreach (Contact item in q) { .... } If you run that, the sql provider retrieves all columns from the table that's mapped to Contact. What would be the simplest way to grab only certain columns but still keep the type as Contact? Here's my attempt: var q = from c in ctx.Contact select new Contact { FirstName = c.FirstName, LastName = c.LastName }; So I am basically, recreating the same object but only populating certain properties. Read More...
|
-
A common use for database querying in a page is to allow users to enter a list of keywords for searching. i.e. "Word1 Word2 Word3" along with some settings options where he can pick something like: [All words], [Any word], [Exact Phrase]. I used that approach to write a learning tool with LINQ. Exact Prase was easily achieved by something like: from q in context.MyView where q.MySearchField.Contains(TextBox.Text) select q which translated to select * from MyView where MySearchField like Read More...
|
-
I am trying to use the new object initialization expression from the query construct: IQueryable<Customer> query = from c in ctx.Contact select new Customer { DoNotEmail = c.DoNotEmail ?? false, // compile time error DoNotFax = c.DoNotFax == null ? false : (bool)c.DoNotFax, // works TransactionId = String.IsNullOrEmpty(c.TransactionId) ? Guid.Empty : new Guid(c.TransactionId) }; As you can see in the code, ?? operator doesn't seem to work. Hopefully, it will be addressed in the release version. Read More...
|
-
hi, My Problem is like this I have database table called 'Emp' in SQL server 2005, I have created its .cs file using 'sqlmetal' utility.Through this file I got a class called 'Emp' , I have created interface IMetaData which i require for specific purpose. This interface is implemented by class 'Emp'. I have also created a class 'MasterForm' which accepts parameter of type IQueryable<IMetaData> my code contains following code //data is DataContext IQueryable <Emp> v1 = from e in data.Emps Read More...
|
-
I am trying to markup an intermediate XML file like one would use to then generate their entity classes from. I can't seem to quite get inheritance mapping working quite right. Here is the relevant portion of my XML: <Table Name="Shape" Property="Shapes"> <PrimaryKey Name="PK_Shape"> <Column Name="Id" /> </PrimaryKey> <Index Name="PK_Shape" Style="CLUSTERED" IsUnique="true"> <Column Name="Id" Read More...
|
-
Cannot set Varchar NOT NULL field to String.Empty as LINQ Generated Property for Varchar NOT NULL field does not detect difference between Nothing and String.Empty. How can I get around this problem? Sample Code When try to set: MyField = String.Empty then ApplicationRef remains set to Nothing as ( Me ._MyField = value) below evaluates to True Sample LINQ Generated Property <Column(Name:= " MyField " , Storage:= "_ MyField " , DBType:= "VarChar(50) NOT NULL" )> Read More...
|
-
I am trying to create a query that has multiple where conditions. I searched through the forum and found Joe Albahari's PredicateBuilder class and I've been trying to utilize it with no success so far. Basically I have a base query: IQueryable<Contact> query = from c in ctx.Contact select c; Then I create the predicate: var predicate = PredicateBuilder.Make<Contact> ( c => c.LastName.Equals("Doe")); The error occurs here: foreach (Contact item in ctx.CreateQuery<Contact>(predicate)) Read More...
|
-
1. Does DLINQ supports remoting? What will happen if I'll pass DLINQ entity out of application domain via remoting? 2. I'm interested in using of LINQ to perform queries over active directory database. Any suggestion? Read More...
|
-
Phew, that's some subject line :) I'm doing a lot of work with the new XDocument object model, which is a vast improvement over the old DOM approach. However, one of the things I need to do is sign and encrypt the resultant documents. In the XmlDocument world, there are the EncryptedXml and SignedXml types which make this simple. Is there going to be anything in the XDocument model to do the equivalent processing? At the very least, will there be a type that can perform a C14N canonicalization transform? Read More...
|
-
Hello! I did read that the January CTP of Orcas doesn't have all the functionality of the May 2006 CTP, but the March CTP of Orcas should have it. Will there be a LINQ version soon that doesn't require to install Orcas? A LINQ version that installs along VS 2005 TeamSuite? And has all the functionality from the May 2006 CTP AND also the "SxS"? Regards CSharpNewbie22 Read More...
|
-
Just wondering what the latest target date is. Thanks. Read More...
|
-
Hi I have 2 questions: 1) Is there an existing operator or method in DLINQ that allows me to perform LIKE comparisons? Is it the StartsWith() method? 2) Once 'Orcas' and LINQ are officially released, will MS provide support for LINQ/DLINQ for VS 2005? Or will users have to upgrade to 'Orcas'? If so, will LINQ be supported in the Express version of 'Orcas'? Regards Justin Read More...
|
-
if i have for example delegate T MyDelegate<T,A>(A a); i want to be able to do so delegate MyNotGenericDelegate : MyDelegate<int,string>; so that i can use the base delegate without passing type parameters each time, and still to be able to use extension methods declared for MyDelegate ... Read More...
|
-
While assigning anonymous types like this: 118 Action < Rectangle , Color > DrawRectangle = delegate ( Rectangle r, Color c) 119 { ... it would be a really great to be able to rewrite it like this: 118 var DrawRectangle = delegate ( Rectangle r, Color c) 119 { Currently this will result in an error: error CS1811: Cannot infer local variable type from delegate or lambda expression The Action<A, B> delegate could reside within System namespace. Or is this already suggested and this just Read More...
|
-
Hello there, I was preparing a post in my blog about implementing spesifications as lambda expressions that take an object and return a bool, the first problem i got is that applying the "And" extension method to two lambda expression will return a boolean expression , and thats not what i needed. what i need is to be able to write this code Expression<Func<Student,bool>> exp1= s=> s.age>18; Expression<Func<Student,bool>> exp2= s=> s.age<26; Expression<Func<Student,bool>> Read More...
|
-
Hi, I'm still just getting my feet wet with XLinq and I have a question. I have a framework that routes message parts to applications code after doing its own processing tasks. A message part is effectively a schema type, but the location of the message part in a given message is variable (or at least unknown by the apps code). Anyway, in .NET 2.0 our framework finds the relavent nodes in the overall message and passes either an XmlNodeList or an XPathNodeIterator to an application function. With Read More...
|
-
Hi, I have a Question about the Mapping how is descriped in 7.1.1 in the DLinq_Overview... Document. I made a class for the Mapping to a DB that looks so: [Table] [InheritanceMapping(Code = "I", Type = typeof(ICQ))] [InheritanceMapping(Code = "P", Type = typeof(Person), IsDefault=true)] public class Person { [Column(IsDiscriminator = true)] public string DiscKey; [Column(Id=true, AutoGen=true)] public int PID; [Column] public string Name; [Column] public string Vorname; } public Read More...
|
-
Does anybody know why anonymous types are using automatic properties instead of public fields? Why was such an approach choosen? Why not just use fields? Is there an article which discusses this? cheers Read More...
|
-
How to write a LINQ Query with Subquery where I want to use "In" or "Not In" clause ? It would be helpful if someone could please provide an example: For example I wanted to convert following sql query to LINQ. "Select CusotmerID from Customers where ProductID in (Select ProductID from Products)" Read More...
|
-
I've been looking into this LINQ thing, and it's looking good. Thumbs up! I watched the videos on Channel9 with the Great Dane Anders Hejlsberg (ok he lives in the US but I like to think of him as Danish) - godt gået Anders og co! I really like the syntax in C# where you turn the query around when compared to SQL, so it is like FROM {x} WHERE {y == 1} SELECT {z}. This I understand was done because of IntelliSense, which is great. Now I have learned that the VB.NET implementation is not turned around, Read More...
|
-
I really want the ADO.NET vNext team to comment on these 2 things. These have been bothering me for some time now. 1) the 'where is what executed' problem. See: http://www.thedatafarm.com/blog/2007/02/13/TheShadowySideOfLINQToSQL.aspx It contains a Linq query which actually doesn't result in a single query but in a query which results are evaluated in-memory, which isn't expected at all, and thus will result in a lot of queries. (point 2 in that blog). When is what executed in the db and when is Read More...
|
-
There are a few things we've seen recently that you might want to take note of: Daylight Savings Time Changes This isn't related to XML, but we're trying to spread the word fairly widely. The US has changed the dates for daylight savings time starting this year. You need to make sure your PCs and other devices have been updated to handle this properly: Windows Update will take care of this, but we realize that not everyone has that turned on; Windows Mobile devices require some manual intervention. Read More...
|
-
i.e. string[] cities = { "London", "Paris", "Seattle" }; var query = dataContext.Customers.Where (c => cities.Contains (c.City)); LINQ to SQL gives this error: NotSupportedException: Queries with local collections are not supported It should instead convert this query to: select * from customers where City in ('London', 'Paris', 'Seattle') Read More...
|
-
Tomorrow, D-Wave Systems with either become a laughing stock, or the state of computing will arguably have advanced by 20 years. They plan to demonstrate a 16-qubit computer running two commercial apps simultaneously, and repeat the feat on Thursday. Now if they can figure out how to get it to simultaneously compute every possible bug-free application, they could save us a lot of effort. You can sign up for premium content on their website. Read More...
|
-
Could anyone please provide an example of using ExceptRows function in LINQ query ? Or substitue in following query. ExceptRows Public Function ExceptRows( _ first as IEnumerable( Of DataRow), _ second as IEnumerable( Of DataRow)) _ as IEnumerable( of DataRow) For example please use the following query: Replace operator "<>" with Except Rows and "=" with EqualRows. Dim RetTable As DataTable = ( From o In ( From A In Elite _ Select A), P In Person _ Where LTrim(RTrim(o.Field( Read More...
|
-
There is a prototype for the CreateQuery method that returns an IQueryable, as opposed to IQueryable<T>. I can't seem to find a way to enumerate through an IQueryable. How is it done? Thanks. Read More...
|
-
Not sure where to report this, but I am not able to download the May CTP. Either it fails to start at all or it stops after about 750KB. I have been downloading all kinds of other stuff today, so I don't think it is on my end. Thanks, Jim Read More...
|
-
I've been fiddling around with some queries and watching SQL Profiler to see if there is a difference between writing a query with an explicit join vs. using already existing associations. For example, with the Northwind db, when you create a datacontext from it, it picks up the relationships between suppliers and products. If I wanted to do a join query to get some aggregate data about order details, I could write something like this : var results = from c in db.Customers join o in db.Orders on Read More...
|
-
In February CTP you will find the same functionality as in the May CTP with many improvements. Some of these improvements came from the feedback of extensive usability studies we conducted in the fall. Observing the obstacles users encountered provided us with good ideas on how to improve the Xml integration features. Some of these ideas are already included in this CTP and we are currently working on others. We also improved substantially the quality of the implementation with the help of our excellent Read More...
|
-
DB.Customers.Count(c => c.City == "London"); Specified cast not valid exception, if there is some customers from London. However Func<Customer, bool> predicate = c => c.City == "London"; DB.Customers.Count(predicate); works well. Another bug(?): When I delete customer from database in one page request and then execute Customer cust = DB.Customers.SingleOrDefault(c => c.CustomerID == deletedCustomerID) ; in the other request, it somehow brings this customer from Read More...
|
-
In LinqToXsdDemo.XsdPrimer.Typed sample code, what does the following line do? po.CompareWithBaseline( "XsdPrimer.xml" ); I can not find any documentation or Help on the function CompareWithBaseline anywhere. VSTS 2005 does not seem to be able to find the definition for it. Read More...
|
-
LINQ is pretty cool but when I see this: delegate TR Func<TR>(); delegate TR Func<T0, TR>(T0 a0); delegate TR Func<T0, T1, TR>(T0 a0, T1 a1); delegate TR Func<T0, T1, T2, TR>(T0 a0, T1 a1, T2 a2); delegate TR Func<T0, T1, T2, T3, TR>(T0 a0, T1 a1, T2 a2, T3 a3); It stands out pretty quickly that a slightly different language structure is needed here... this brute-force approach is trouble. What if I need a predicate with 13 parameters? I've lost the convenience this Read More...
|
-
Bravo to the C# team for making a language like LINQ a first-class language-extension with all of Microsoft's tools behind it, this really is revolutionary. It seems that LINQ's lambda expressions offer ASP.Net pages a major new opportunity: 1) Set a Datasource for all controls on the page 2) Let controls simply ask for data as though they were accessing object properties 3) The ASP.Net engine could take the following steps: a) Create a LINQ expression for each data request (some requests may be Read More...
|
-
Scott Guthrie has an excellent video showing off LINQ to SQL in ASP.NET, using a build that should be pretty close to what you can expect in the upcoming CTP. You can follow the link from his blog (yes, I did have to hit backspace to replace a 'q' with a 'k'): http://weblogs.asp.net/scottgu/archive/2007/01/28/video-using-linq-with-asp-net-in-vs-orcas-part-1.aspx Read More...
|
-
May 2006 Linq CTP contains code generation utility for DLinq. How does Orcas support DLinq? What shell I do to start to work with my database in SQL Server? Read More...
|
-
XQuery 1.0 and XPath 2.0 are now W3C Recommendations, thanks in part to the contributions of several Microsoft employees over the years. An earlier draft of the XQuery specification is supported in SQL Server 2005 , and you can send an XQuery to the server using the ADO.NET that shipped in Visual Studio 2005. These features are becoming widely used. Now that the XQuery family of specifications is complete, it’s fair to ask what our implementation plans might be, We had been working on an implementation Read More...
|
-
Is the current plan for LINQ to SQL to include support for other databases? Or will support for other databases be in another assembly? Thanks. Read More...
|
-
Hi! I wonder if anybody knows when this month Orcas CTP will be available? Regards Read More...
|
-
Kindly Let me know the DLINQ syntax for the following SQL Query SELECT row_number() over(order by tablecolumn) as rowid, * FROM table ORDER BY tablecolumn Read More...
|
-
|
|