VS 2010 Upgrade From 2008 To 2010 - Now LINQ - IntelliSense Is Not Working For LINQ Stuff
Apr 20, 2010
I just upgraded a project from VB 2008 to VB 2010. Before, the project did not use LINQ. I have started implementing it. So, I have updated the target framework from 2.0 to 3.5, and added a reference to System.Core, and imported the namespace System.LINQ to the entire project and also imported System.Data.LINQ into the form I'm working with (because it was not available in the list for Imported Namespaces in the references tab).
It's not throwing any errors now, but my IntelliSense is not working for LINQ stuff.
For example... I write this:
[CODE]....................
Then, if I type S. on the next line, the IntelliSense doesn't grab what it should for S (Only get Equals, GetHashCode, GetType, ReferenceEquals, and ToString, instead of the options I should get like Count, First, FirstOrDefault, etc...). If I Type S.First. then its the same thing, no IntelliSense that lists the available fields for S, just the standard options (Equals, GetHashCode, GetType, ReferenceEquals, and ToString). I should be seeing my column names in my table when I type S.FirstOrDefault.
So any ideas what is going on? When I type the code, for example, MessageBox.Show(S.FirstOrDefault.FirstName), it works perfectly. But it doesn't change the casing of the text (so it would read s.firstordefault.firstname) and no intellisense while doing it. But no errors. BTW - Everything works perfectly when creating a NEW VS 2010 application, it's just my projects upgraded from Visual Basic 2008 that have this issue.
View 2 Replies
ADVERTISEMENT
Aug 25, 2011
I have following simple code:
[Code]...
View 3 Replies
Feb 13, 2010
What happend to my Intellisense?When I type a line like this ...
Dim users = (From u In Membership.GetAllUsers Select u.UserName)
I get (almost) no Intellisense when I get to the Select u. part. Only Equals, GetHashCode, GetType, ReferenceEquals and ToString appears. Not "UserName" and the other relevant propeties of the MembershipUser class.The code compiles and works just fine.
View 2 Replies
Feb 18, 2012
I have just upgraded to 2010 and i am having a problem with my first conversion. Part of the applications form load which as been converted from 2008 to 2010 is to check if a string in my settings is empty or not (databasepath), if its empty then browse for the file. If the user prsses cancel then it should close the application. This was working fine on 2008 but now it gets to Me.Close, goes to formclosing then comes back to where it was in form load and carrys on until it throws an error further down the code where it shouldnt really get to. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[Code]...
View 4 Replies
Sep 19, 2010
Checked out the video on MS website by Beth Massi and downloaded the project.
One query she uses this statement,[code...]
I'm I missing a reference or something? This is an Access DB, does that make a difference?
View 7 Replies
Nov 16, 2011
In proper sql my query would be something like:
select c.id, c.name, count(i.id)
from cats c, items i
where c.id=i.catid
[code].....
View 1 Replies
Aug 6, 2011
THE CODE IS :
var query1 = ((from c in dt.AsEnumerable()
orderby c.Field<int>("1") descending
select c));
var query2 = (from c in query1.Take(10)
select c);
[Code]...
View 1 Replies
Sep 18, 2010
I need to create an application that is able to modify the XML elements value.I have an XML file which was created by another to be used for flash movie which has the following layout:
<?xml version="1.0" encoding="utf-8"?>
<games>
<game>
<gameName>Cowboy</gameName>
[code]....
As you can see there is this string "™" on <gd02>. My question is, whenever I save the file, the code changed to "TM" which is fine for most cases. But I need it to stay the same because apparently flash will not display the superscript "TM" if not using the code. How can I do this?
View 6 Replies
Apr 9, 2011
I need help on how can I transfer a query from Access to LinQ that calculate the average in time per transaction during a given date.the working Access query is:
Avg(DateDiff("s",CVDate(Format([start_time],"hh:nn:ss")),CVDate(Format([finish_time],"hh:nn:ss")))) AS Expr1, Format([Expr1]3600,"00") & ":" & Format(([Expr1]60) Mod 60,"00") & ":" & Format([Expr1] Mod 60,"00") AS format
How can I port this to LinQ?
View 1 Replies
Jul 4, 2010
I have an array of approximately 1000 classes. All of these classes must have one of their properties changed to the same value. I need this to be as optimized and fast as possible.
Would LINQ be faster than a for-loop? Any other ideas for faster execution?
View 11 Replies
Jan 18, 2012
Is there a way to use LINQ to filter a DataTable for rows that contain particularcharacter but in a "Accent Insensitive" way? Search over the web I came with something like this:
Dim dt As DataTable = CType(BindingSource1.DataSource, DataTable)
Dim SearchVAlue As String
SearchVAlue = "e"
[code].....
View 7 Replies
Mar 13, 2012
I am trying to read information from a text file(.txt) using LINQ.I can't use a list box of predefined continents that someone can click on and it will bring up data from that continent.It will work if I let the countries fill the list box from the text file but then if I have two people from England my list box will display England more than once.For example my UN.txt file that is in my debug folder: [code] So I guess I have two different questions: 1. Is there anyway to stop the duplication of the continents as shown above? Can I pre-fill the list box with the continents and not have to fill it from what's in the data file?
View 14 Replies
Dec 2, 2011
I'm having trouble figuring out what to do with the bolded part, when there are no nodes to return.If there are no image tags inside the <images> tag, i get an "Object reference is not set to an instance of an object".I have been searching and searching for an answer but can't find one.
Dim orders = From o In xmlLinq.Descendants("order")
Select New With { _
.orderID = o.Attribute("id").Value, _
[code].....
View 2 Replies
Mar 30, 2012
I'm really struggling with this. I have two XML files. The first one has items, and then sub elements for properties:
[Code]...
View 3 Replies
Jun 13, 2012
So I have a query I'm doign where, at the moment, the places to search are set in stone, but the values that maybe be searched for is variable.Right now, I have a drop down menu that allows you to choose a character class. This limits the items to a specific class. Then I can filter on text from a textbox.
However, each item in the list has a source, based on the book it is published in. I want a user to be able to choose several from a checkbox menu, then pass those values for inclusion in the criteria for finding items.
The problem I'm having is finding the most concise way to do dynamic WHERE clauses. There are several examples out there, and even a couple don't seem to want to do exactly what I'm doing, and I'm having trouble determining if it will work for me.
View 8 Replies
Jul 2, 2010
After being quite sick of the my.settings-file behavior, I started to create an XML-file (with unique values). Now this works great!!! All my settings, connectionstrings, etc are loaded from an external file and won't be overwritten by the app. itself. But I was wondering how do I save a value/setting? Simple example:
HTML
<test>
<country>Holland</country>
[code]....
read the XML and node:
vb.net
Dim readXML = Xelement.Load(Application.StartupPath & "XMLFile1.xml") ' check if the node isn't empty (crash) If readXML.Descendants("country2).Nodes.Count > 0 Then Textbox1.Text = readXML.Descendants("country2).Nodes(0).Tostring() Else
[code]....
View 4 Replies
Jan 20, 2011
I have been using VB6 forever, but I need to to create new app versions for Vista/7, and beyond. My employer bought Visual Studio 2005 Pro a few years back, but i have never opened it.What would be the best upgrade step for me from VB6? Is 2005 adequate, or 2008, or 2010?
We primarily create apps for building and hardware controls, monitoring, logging, and communications. Will be using MySQL in the cloud with apps too.
View 5 Replies
Apr 12, 2012
I am working on an application in which i need to use reporting. i have used LINQ to entities and MS SQL server as database in my whole application. Now when i started working reports i noticed that crystal reports or no more included in visual studio. i downloaded it separately and installed it. i have also designed my report successfully but the problem is that how would i use LINQ with it?? I translated my linq query into datatables and it worked but the problem i am stuck at is, my report is based on two tables, after translation i am able to see records of first table but not the second one.
View 1 Replies
Jul 23, 2009
I'm trying to obtain name/value pair of enumeration typed into text box with LINQ. It's OK with name, but when LINQ reaches values, it throws error: "Conversion from string "Black" to type 'Integer' is not valid". I have read that if I want to obtain a value, then I gotta use conversion function.
Here's code (button's Click event):
Private Sub GetEnums(ByVal sender As Object, ByVal e As RoutedEventArgs)
lstEnums.Items.Clear()
Dim typeName = Type.GetType(txtEnum.Text)
Dim enums = From en In typeName.GetEnumNames
[code].....
View 6 Replies
Sep 24, 2011
How would I go about counting the number of times a given query occurs inside of a text file using LINQ?I need to search through the attached file and see how many justices were appointed by each president, and then create a new text file displaying the following:
presName, justiceCounter 'president name ordered by first name, number of justices appointed
I pretty much get how to do everything except for keeping an accurate counter within the LINQ query. However, I do feel confused about the order in which I should write this code, as in where I should keep my counter for how many justices a given president has appointed.
My output is displaying like this:
Abraham Lincoln,111
Abraham Lincoln,111
Abraham Lincoln,111
[code]....
View 10 Replies
Oct 21, 2011
I have following data in the arraylist..
HTML
ID Type Size
1 Car 1 1000
2 Car 2 1100
3 Car 3 1200
[Code]...
View 6 Replies
Sep 20, 2011
For a class project I am supposed to search through the attached file, and write to a new file the years between 1789 and 2009 that are not present in the fifth field. What is my best bet for determining what years are not present?
[Code]...
Should I make an array of integer between 1789 and 2009, then search for every year in the file, then set a flag to false if not found; is there a simpler way to accomplish this using LINQ?
View 7 Replies
Oct 19, 2011
I am using DataSet.ReadXml() to create a DataSet from the following XML file, so that I can quickly query it using Linq.[URL]..I then use the following object to create a DataTable which can be used as a dictionary, with a ConvertToFriendlyFormat function that takes an Emulator_Id and and a string that corresponds to a DicEntry node's StoredFormat attributed, and return the same node's FriendlyFormat attribute.
This does work BUT it is extremely slow (~11 seconds to call it ~220 times). I have been unable to figure out how create the DataSet when the object is initialised and just query the simple DataTable in the ConvertToFriendlyFormat call. I guess this is what is slowing it down?
[Code]...
View 4 Replies
Sep 1, 2010
I am wondering if it is possible to filter data from a datatable.Sample datatable
Quote:
Sno CatID Nos
1 XYZ 25
[code].....
View 5 Replies
May 9, 2012
I want to create a LINQ to entities query getting data(join) out of two tables and bind the result as datasource to a datagridview.
Unfortunately I seem to stumble upon a syntax issue.
Table 1 : dcpricing.tblpricing
Table 2 : dcpropertydetail.tblpropertydetail
Grid: grdpricing
[Code].....
View 5 Replies
Feb 6, 2011
When I query a DataTable using LINQ, are the rows returned as references? Either way, is it possible to control this behaviour, so that rows are either returned as references or as new rows?My guess is that all objects are returned as references by default, since that seems to be the normal behaviour in most programming languages.
View 2 Replies
Sep 9, 2010
I am using LINQ queries inside a WCF service to return data to a Silverlight frontend. Problem is the columns being returned using LINQ are in alphabetical order and I want them the way they are ordered in the database instead. Does anyone know how to stop the alphabetical ordering of column names?
View 4 Replies
Jun 23, 2011
Here's what I tried, but I get an error at run time on the AddRange line that states "Only parameterless constructors and initializers are supported in LINQ to Entities."
[Code]...
View 5 Replies
Mar 24, 2011
I am creating a mediaplayer / playlist creator tool that basically imports MP3 songs into playlists (grids). I'm looking to add search functionality where the user can search all open playlists (or a subset of the open playlists). A Playlist is basically a collection of AudioFiles, where an AudioFile is a class that holds the filename of the MP3 file and then exposes the tags (Title, Artist, Album, etc) in public properties.
The idea is that the user can search for a certain expression (for example "the"), and that he can then choose whether to search in the title, in the title and artist, in the title or artist, in the title, artist and/or album, etc. However, I'm having a hard time implementing this and also having it kind of dynamic.
At the moment I am simply gathering all the AudioFiles from the open playlists (or from the subset of playlists the user chooses) and then running a simple LINQ query to find those AudioFiles where the Title contains the search text. Then I display the resulting AudioFiles in a new playlist window:
[Code]....
In case the AND / OR distinguishing is too hard, I would be happy to start with just letting it default to 'OR', so that the user can check Title and Album for example. If he would then search for 'a' then all songs that contain 'a' in their title as well as all songs that contain 'a' in their album should be returned. I guess that makes it easier, but I still wouldn't know how to dynamically create the LINQ query.
View 2 Replies
Jan 15, 2012
I started developing an application several weeks ago and decided today that I may want to use LINQ. So I changed my project from .NET Framework 2.0 to 3.5 and restarted the program. However, I can not get the most basic LINQ statement to work. I thought it was my code until I started a blank .NET 3.5 project and inserted the basic code (below) which worked without issue. So I then started another .NET 2.0 project and inserted the code (which I knew wouldn't work) and the errors are the same as the project that I converted. So next I converted this new .NET 2.0 to 3.5 and the code still doesn't work. So migrating from 2.0 to 3.5 isn't working for LINQ.
My question is: If one changes from a .NET 2.0 to a .NET 3.5 how do they get LINQ to work properly?
[Code]...
View 2 Replies