it works absolutely perfectly. I add nodes to the xml document, then I add child nodes using linq query to pull data from a datatable.My problem is. After the LeanerBiographical Node I want to add another node, but when I try the code i higlighted in blue, which needs to go in after the code highligted in red I get this error:Range variable name can be inferred only from a simple or qualified name with no arguments.for the life of me I can't get tgis to work and I need it on Friday. plz plz help me LINQ experts
How can I retrieve the Major and Minor version of the Application ? I wouldn't ask , but every time I try to use the My object to retrieve those properties , I only receive 1 and 0 , though I manually set them to 3 and 8 (from the project properties)
im trying to make a short term ordering system for my major work for year 12 , i need to know how to run a timer in a label and progressbar at the same time , run by selections by combo boxes in another form.
I am having troubles on what each of these mean.Mayjor, Minor, Build and Revison mean.I found a link to a topic like this, but I totally did not understand it.how to I apply the version details? I went to the properties of my progect and when to the publish tab, and set it in there, but when I right click on my application, it still always says, 1.0.0.0.How do I make it so it will say the version that I have it set in the publish tab?I am not publishing them to the internet,I don't have and FTP or what ever you need, plus I don't think there is a point to publish my programs, they are low level compared to everyone else who programs.
One more thing.If I want to make it so the application is done for that version, and is ready to be used on other computers, should I just use the app that is in the debug folder, or should I build it, then use the one that would be in the release folder, or is there something better that I should do?
I am coding an asset management system for telecom as my major project.It features submitting asset information,retrieving an asset information by entering the id of the user responsible for it,checking the number of live,stock and scrap assets and downloading it in an excel file and updating any asset information if needed.It has an admin login to it and even a change password form.
I'm running into a little problem making one combo box dependent on the selection of another combo box. I'm using a access back-end to this project. I have two tables: MajorCategoryTbl and MinorCategoryTbl , MajorCategoryTbl has PK and description field, MinorCategoryTbl has a PK, MajorID (foreign key), and description field. I have two combo boxes on my form, one that displays the Major description, and one that displays the MinorCategoryTbl description, but the stored value is the PK for both. I want the selection of the minor category combobox to depend on what was selected in the major category combobox.
I need to determine which students have a specific major based upon the button that is clicked , then code will pull all the CS student's name and put them in the results list box. The text box above the results list box should contain the specified major and the text box below the results list box should contain a message indicating the total number of students with specific major.
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.
if there is a Linq way of doing a TOP to only select part of a datatable? Unfortunately the data won't have it's key yet at the point that I need to do this (in fact, it's the key that we are trying to get back to in the end) so I can't use a where clause that looks at the key and gets the items between a range. Looking for something that's is the equivelent to SELECT TOP 1000 a,b,c FROM ABC ... but in Linq.We're using Linq to XML to transform a datatable to xml, then send it on over to SQL Server for processing. That works fine and dandy - and amazingly fast.
How ever, I've run into a problem where my datatable has an unusually high amount of records (for the type of data that it is). I need to move data on the order of 60k records to the database at some point. currently we're looping through the DT and calling the sproc.... if I did the numbers right, that will take somewhere around 33 hours... easily not an option. Ok, so our best option is to transform the DT into an xml document and send it off, then deal with the data in set transactions. Problem is that I just can't see us sending 60k rows worth of data all in one shot like that....
I am loading al lot of data from a server to a local PC. Then i crate a disconnected table localy and move data from the server to the local PC.Then to update the userinterface (Wondows forms datagridview) i think i will use Linq ti move from this local tabel to the datagridview. On server there is 1000 000 rows in first tabel(source), to the user i have 30 000 rows each time the user loads forms and greate a smaler local table.That is once a day. But each time the user move to next row in datatabel there is 12 rows from my local table who is printed into the a new datagriview.How do i connect Linc to my ado table ?
This is an extension of my last question which was answered, so I am starting a new thread. I have a query in LINQ that I was given to trim down the columns of a datatable. This works well, however, I need to make the LINQ query dynamic. So the query below:
Dim qColumnsIWant = From row As DataRow In inDT.AsEnumerable() _ Select _ EPN = row.Field(Of Integer)("EPNID"), _ EPNID = row.Field(Of String)("EPNNumber"), _ Ingot = row.Field(Of String)("Ingot"), _ ShopOrder = row.Field(Of String)("ShopOrder")
I have seen different examples in Linq and one used Select and another didnt but both return the same results. Is there a reason why we should use Select ?
I have a listbox on my xaml form that I bound to a List(Of MyType) property. I populated this list like so:
Dim fields As List(Of CheckableFields) = New List(Of CheckableFields) Using context As ITIPEntities = New ITIPEntities() Try[code]....
Now I'm at the point where the user selects the fields they want included in a report and I need to iterate over the required fields. This is my linq query:
For Each checkedField In _requiredFields If checkedField.IsChecked Then If checkedField.FieldData IsNot Nothing AndAlso checkedField.FieldData.Trim IsNot String.Empty Then[code].....
I am curious as to the proper technique to use SQL Server's AppRole with a LINQ to SQL Class. I understand I have to establish the intial connection with no connection pooling. However, do I simply call the SQL stored procedure sp_setapprole using standard LINQ before executing any of my methods that interact with the database, or is there a better way to enable and use AppRole within the LINQ to SQL class?
syntax of the LINQ query to use GROUP something BY something and select some fields of the datatable. i am having a datatable filled with some rows, i am trying to fill the datagridview with the GROUP BY query output of some fields.
I'm just getting my feet wet with LINQ but am struggling to convert this SQL statement to LINQ.
Dim SQLString As String = "SELECT MESSAGE_ID FROM " & Schema & _ ".PPM_TRANSFER_EMAIL WHERE TO_CHAR(IMPORTED_DATE,'YYYY/MM/DD') <= '" & _ DeletionDate.ToString("yyyy/MM/dd") & "' AND IMPORTED = 'Y' AND FILE_NAME LIKE '" & _ mb & "%'"
I have a Dataset that already contains all the data from the PPM_TRANSFER_EMAIL table so it seems silly to query the database again when I can use LINQ to query the dataset.
in the query creation part,the evensQuery and num are not defined.....then how does it work Secondly,i read this from MSDN:In Visual Studio you can write LINQ queries in Visual Basic or C# with SQL Server databases, XML documents, ADO.NET Datasets, and any collection of objects that supports IEnumerable or the generic IEnumerable<(Of <(T>)>) interface Now how can i know whether the collection of objects supports IEnumerable<(Of <(T>)>) interface or not?
I'm a bit of a n0ob to all this and I'm having trouble finding good resources on the net.What I'm trying to do is define a one-to-many relationship between two entities. I'm using the GUI tool in Visual Studio - and have created the tables in Microsoft SQL Server Management Studio.Basically, I have two tables....a 'Users' table and a 'Sites' table. A single user can have many sites associated with it.Users has a primary key of 'UID' and the Sites table as a primary key of 'Site_ID'.Sites also has a column 'UID' that should indicate which user that site is associated with.Anyway - it sounded pretty simple; but no matter what I attempt to do, I can't seem to get it to work. Mostly, I get validation errors - sometimes run-time errors, or sometimes, no actual data even though there should sites that match the UID of the user.I am able to connect and write LINQ against my Users table/pull down User objects - but can't seem to get it to know that the Sites are associated with the user.In the GUI - if I go to 'Add Association' and create a 1 to many link between Accounts and Sites - and Validate - I get an error saying, "Error1Error 11008: Association 'AccountsSites' is not mapped."
It seems like, when I try to make an association, it wants to link the 'Keys' of each entity.But U_ID and SITE_ID are the keys and, obviously, shouldn't match.If I click on the line it created in the GUI and I go to 'Table Mapping' I can see that it is trying to match those keys. Since I want it to match user_ids my first thought is to just make the U_ID the entity Key in the Sites entity but, of course, that's wrong because it would no longer allow a 1 to many relationship.
vb Dim CheckedRows = From dgv As DataGridViewRow In Me.DataGridView4.Rows _ Where dgv.Cells(0).Value = True _ Select New With {.a = dgv.Cells(1).Value, .b = dgv.Cells(2).Value}
my code above works fine but how to get the index of the row on which the checkbox is checked
So, I'm not really sure if I have this setup properly or not. This is my first attempt at utilizing LINQ and I am trying to return data directly from an XML file.Here is my XML structure:
I've been having this niggling issue that's been driving me nuts. Maybe there's something I'm not doing quite right, I don't know. I'm hoping someone with more experience on the subject can show me a better way or just confirm this with a "Jenner, you're not nuts, that's just the way you need to do it".The problem is this. Every time I try to use LINQ to enumerate a Collection, and for this example, I'll use a Collection of TreeNodes in a TreeView control; I get an error of:
Option Strict On disallows implicit conversions from 'Object' to 'System.Windows.Forms.Treenode'. for the following
I encountered something like a logical error which I could hardly resolve since I'm new to this technology. I'm using visual basic 2008 express edition with its built-in linq-to-sql technology. I was able to retrieve, add, edit, and delete such record using the linq-to-sql method, but one thing.I could not get is something like relational database operation. Here is my problem. As you can see the table above which represents the records on my database. You can notice there some account numbers that were duplicated which I used as the primary key or identifier. What I want is when I'd like to query such account number it should display all the records that have the same account numbers on it. Say for example, if I query the account number 00003. It should only pull up and display three records with the name Maverick and their corresponding address, movie rented and date.What is happening in my end is when I query such account number which are being duplicated in the database I encountered two things, its either it would display all the records in the database with different account numbers associated or it gives me an error message if I change my code from 'For Each memrec In db.Table3s' to 'For Each memrec In retrn' statement.What I've been trying to do here is if you enter the account number on the search box, it should only display the records on the combo box associated with the account number being entered. Like if you enter 00003 on the search box, it should only display the three movies rented by Maverick no more no less on the combo box. [code]
I have already tried that set of codes before but it's working the same thing. I tried many times modifying my codes before I posted my comment in this forum thinking that i can resolve it on my own but I wasn't able to. That code won't still filter the records in the database. I would like to verify that the table above is only representation but the real column on the table on my database is 'Account#' not Account Number and visual basic would detect the code as 'Account_'. May i know why Movies_Rented column on my table is not a member of string? Why is it the code you gave would still display all the records on the combo box? this is what im not getting. hope you can still find the solution to this issue.