Do Queries Against Hierarchical Data Using LINQ To SQL?

Mar 17, 2009

I have 2 tables that are related. Each app can relate to many apps. ie, office can be related to word, excel.[code]I would like to do the following query. I use vb.net but c# is ok.Query is to return all the apps that are not related to (1), so the result should be (4, quake) .

View 3 Replies


ADVERTISEMENT

LINQ Queries - Combine The First 3 Queries Into A Single Query And Place In A List?

Jan 6, 2010

I am writing a message system on my server, the xml is something like this

<xml>
<entry>
<sender>[code]....

my problem now i guess is 2 fold, i wish to combine the first 3 queries into a single query and place in a list or a collection or is there a way to do this with a single query that will give me my desired result?

View 1 Replies

.net - Know To Refresh Linq Queries?

Aug 24, 2011

I have a basic grid of Linq2Sql entities (frmList). I have a separate form for editing (frmEdit). frmEdit has its own DataContext (as that appears to be the recommended way). How can I tell when my detail form has saved changes?

I don't see a built-in method. I am considering raising an event on the detail form when I save the datacontex, but not sure how I consume this event on frmList, and I have a feeling these events are already created for me somewhere?

View 1 Replies

Linq Combining 2 Queries?

Oct 11, 2010

Let's say I have 3 tables: carts, baskets and eggs where a basket can contain many eggs and where carts contain many baskets. Each basket has a foreign key that maps to a cart and each egg has a foreign key that maps to a basket.I need to return a table that contains these 3 columns:Cart Name | Count of Baskets in Cart | Count of Eggs in Cart.Each table is an EF and I'm using linq with VB.So far, I have 2 queries: one that returns the columns Cart Name and Count of Basket and another one that returns Cart Name and Count of Eggs. How can I combine these two result tables so that I get the results in one table?

Dim query1 = (From cart In myEntities.Carts
Where cart.UserID = TheUserID
Join baskets In myEntities.Baskets On baskets.CartID Equals cart.CartID

[code]...

View 2 Replies

.net - How To Merge LINQ-to-SQL Queries Optimally

Mar 13, 2012

I have a function used to filter a list of options to return only those that are lot traced, and, when applicable, also only show items matching a specified pattern:

Private Shared Function FilterResultsLot(ByVal source As IQueryable(Of Item), _
ByVal itemCode As String) As IQueryable(Of Item)
If HasFilter(itemCode, True) Then

[Code].....

View 1 Replies

Asp.net - The Specified LINQ Expression Contains References To Queries That Are Associated With Different Contexts?

Apr 5, 2011

I know there are similar questions on stackoverflow - and I looked through them and think my issue is somewhat similar, but haven't been able to find a solution by looking at any of these other questions/answers.I'm getting the error when attempting to execute the following code:

Private Sub btnReserve_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReserve.Click
' Check that the room is still available.
Dim dbCheckOccupants As New pbu_housingEntities
Dim hall As String = CStr(Session("hall"))

[code]....

It is catching an error on this line:

Dim myID As String = GetID.First.id.ToString

As far as I can tell I'm not using multiple contexts?

View 2 Replies

ComboBox DataBinding DisplayMember And LINQ Queries

Apr 7, 2009

I decided to iterate through the Data.DataTable and trimmed the values there.Utilizing SirDemon's post, I have updated the code a little bit:

[code]...

I know that on the DisplayMember line the .First.Item() part is wrong, I just wanted to show what row I am trying to designate as the DisplayMember.

View 3 Replies

LINQ. Reducing The Code By Using Dynamic Queries?

Feb 17, 2011

I use the following code to fill the Table1 dictionary with the information found within the LINQ query.

Dim DB As New DatabaseDataContext
Dim Table1 As New Dictionary(Of String, Integer)
Dim Table2 As New Dictionary(Of String, Integer)

[code].....

View 3 Replies

Display An Organized Hierarchical Data In 3.5?

Nov 10, 2009

I am working on a project that organizes the structure and hierarchy of departments. I want to view and display the whole structure of the organization visually, but I am stuck. I wanted to know what is the best way to do it in ASP.net 3.5; my goal is to achieve something like this by code and each node is linkable and can have CSS.

View 2 Replies

Hierarchical Data For Application Settings?

Jan 6, 2011

(using VB.Net 2008) I have been using the Settings feature of vb.net to store user/application settings of my program. For small stuff it's great, but quickly starts to feel limited as the data gets more complex.Now I need to group certain settings together and organize them in a hierarchical (or relational) fashion. But from looking at the Settings tab inside of .Net, everything appears to be stored completely flat. So what's the best option for me? Some ideas I have are:

1. Use a small local database (such as an .mdb or .sdf) to store user settings. I think this could become a pain if I ever needed to update/create more settings while avoiding losing previous user data - not very flexible to change.

2. Use datasets and convert the tables to XML files.

View 1 Replies

Match Hierarchical Data To Flat?

Apr 6, 2011

I have 2 representations of similar data from 2 different systems and I need to match each entity in one system with the entities in the other.[code]...

View 1 Replies

Populate TreeView With Hierarchical Data?

Feb 5, 2010

I'm trying to populate a treeview on a windows form app with Hierarchical data from a SQL db.[code]...

View 1 Replies

Treeview To Create A Hierarchical Data?

Sep 28, 2009

I m using Treeview to create a hierarchical data. I have 3 tables which i m using to create an hierarchy. So that it would be as:

[Code]...

View 1 Replies

VS 2008 Use Queries And Dealing With Databases Using LINQ Or SQl / Which Is Better To Start

Jul 6, 2010

I will start a new project, use the queries and dealing with databases using LINQ or SQl ,Which is better to start ???

View 4 Replies

[2008] Dynamic LINQ Queries And Select Statements?

Jun 5, 2008

I've recently ported my website from 2005 to 2008, and I'm using LINQ Queries to implement a search. The issue is that none of the fields are mandatory, so I've had to implement a dynamic LINQ Query (sic?). Here's the relevant code -

Public Function searchQuery(ByVal titleType As String, ByVal titleName As String, _
ByVal configMgr As String, ByVal lifecycle As String, _
ByVal CIType As String, ByVal recordsPerPage As String) As IEnumerable(Of

[code].....

View 2 Replies

Working With System.collection.generic.Ienumerable/XML Linq Queries?

Oct 22, 2009

This is really a continuation from my earlier post. I've never worked with this datatype/collection (system.collection.generic.Ienumerable) before so I'm struggling to declare the query globally so I can reference the results within other sub routines/functions. I also am struggling to convert it to other types.how I can convert the collection of xml elements/system.collection.generic.Ienumerable into an xmltextreader (I know I will have to change the query below as it select the value of the node and not the node itself) I imagine by converting the query result to system.IO.stream My first port of call was MSDN but I find the material very difficult to understand for this particular subject.

[Code]...

View 3 Replies

The Hierarchical Structure Of A Dataset In Data Source Window

Apr 11, 2011

if it matters which of the repeated tables you drag onto forms? I know there's a parent-child relationship between orders and details, which is why details appears "under" orders, but details also appears in other places. What's the difference between its different appearances below?

View 4 Replies

VS 2010 Same Data, Different Queries, Different Listboxes?

Sep 6, 2011

I'd like to display the same data in 6 different listboxes but with different queries.The data is formatted as so:

ExptStage
expt1Expt List
expt2Ready to Print

[code].....

View 8 Replies

Combining Data From Multiple TableAdapter Queries?

Mar 9, 2009

I am trying to fill a temporary table with one column( a code) with the unique results of three queries of their respective table adapters.I can't figure out how to do it from here.The database is Access 2007 and I have activated the appropriate dataset on the form from which this code executes. The table adapters are part of that dataset.I could try to use the recordset approach, but that means making another connection to the same database.Is that a preferable approach?My purpose in doing this is to build a VB process like the one that works in a VBA Module of this Accessdatabase, partly to help me learn VB2008 and partly to overcome the necessity to keep updating queries used by the module.Code below

[Code].....

View 4 Replies

Fill Datagridview Intercalating Data From 2 Queries?

Jun 16, 2010

I have a Datagridview, It will have pairs of lines:

first line: requested customer
second line: assigned quantity for that item for that customer

Something like:

CUSTOMER-ITEM-VARIATION1-VARIATION2-VARIATION3-VARIATION4
Cust001....-120.-......10........-.........0.......-........8........-.........1
Cust001....-120.-........0........-.........0.......-........0........-.........0
Cust002....-120.-......15........-.........7.......-........2........-.........0
Cust002....-120.-........6........-.........0.......-........1........-.........0

The second line will have numbers if other table has information about that customer reservations, or will be in 0 if not.I can load the first line of each pair, with the data of the "requested" items loading a datagrid with a datatable.

View 2 Replies

SQL Queries - Sorting Column Without Changing Data In Other One

Feb 15, 2012

I have a problem with sorting this thing. I want to sort a column without changing the data in the other column. i have an attached document. A picture of my query and database..

View 3 Replies

DB/Reporting :: SQL Query - Use The Data Properly With Different Forms And Different Controls With Queries

Apr 21, 2008

I am working on a Data Survey Project and first I have a few questions about the different types of databases, and second, I need help querying my tables that have relationships.

1. I need a database that is stand alone. It is just the back end for the program. Simply to hold all the data an employee gets while out on a job. So would I be better using access, or SQL Express? I have played with both, but I do not want a large redistribution to my user machines. When I compile and produce this app does the SQL Database still work without installing any SQL Technology? Or do they have to go in after they install my app, and install Express?

2.Overview: I suppose depending on the first question regarding the database, it might change this question a bit, but none the less...I have 4 tables( using Access at the moment) I will be generating Reports based on data in the database. I haven't gotten that far yet. *Project* is the table that holds all the details that pertain to the job and client. It has a "one-to-many" relationship to *Survey*. So for one customer there are going to be many Survey Records. *Project Type* also has a 1-to-many back to *Projects*. Parts is kind of an orphan, but is linked to the *Survey* table with a one to many. So there can be many parts for one survey. I wanted this table for a drop down box, so the user could just simply select what hardware he was using instead of typing all the names and parts.

So in VS 2008 using the Designers and related Query tools, how do I constrain the Survey Data to one Customer? I have one form that opens from a button that is "New Project" and then there are all the *project* fields listed, so the user fills out the info and hits accept and that opens a new form called "frmSurvey" I need to add some code to the accept button to check what type of project is selected from the frmNewProject and then run a select query based on that. How do I write query statements in the code section of the form, without using the Visual Database tools?

Ill stop here, and get these questions out of the way first. If I could just get a handle on how to use the data properly with different forms and different controls with my queries, that would be great.

DATABASE

CODE:

View 4 Replies

VS 2008 Bound - Source Data Of Drop Down Lists Be Separate Queries / Datatables?

Jun 2, 2009

I've got a couple of drop down lists for languages. I bind them to a language list that comes from a query. Then the fields are also bound to the row in the DB they relate to. I have several panels with the language drop down - each "tied" to a different table in my DB. When I call up different records on the same panel the drop downs immediately "set to the position" of that rows language in the list. But when I call up another panel - tied to another database table - I see that language in the drop down.

[Code]...

View 9 Replies

Displaying Hierarchical Xml In Asp.net - Vb

Jan 25, 2011

I've tried converting some code from c# to vb but it's not working and I'm not sure why. It's supposed to render hierarchical xml. Here's the code...

[Code]...

View 1 Replies

Convert An Object System.Data.Linq.DataQuery To System.Linq.IQueryable?

Oct 21, 2009

How can I convert an object of type System.Data.Linq.DataQuery to System.Linq.IQueryable?I'm working with Visual Basic/Silverlight, and the source code of my query is as follows:

Public Function Get_Cli_Pag() As IQueryable(Of V_Cliente_Pagare)
Dim Qry = From P In Me.Context.Pagares Join C In Me.Context.Codigos On C.Codigo

[code]....

View 1 Replies

Create A Hierarchical Datagrid In Asp.net (.net 2.0)?

Apr 16, 2012

How can I create a similar hierarchical datagrid in asp.net (.net 2.0) using VB.net This is the gridview, which is shown after the conversion wizard. How it is desgined(it's like a hirerachial).

View 1 Replies

Create A Hierarchical Datastructure Just Like Xml Using .net?

Jul 14, 2010

i want to crate a hierarchical data structure same as XML, means parent, child, sub child... like that one using vb.net. so ho can i create that one?

View 2 Replies

IDE :: Create A Hierarchical Grid?

Apr 2, 2009

im trying to create a hierarchical grid on vb net but im failing to acomplish

this is what i have already but not working

Private
Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

[Code].....

View 4 Replies

Develop Hierarchical Datagrid In VS 2008

May 28, 2009

I think datagrid able to display hierarchically with datarelations in earlier version. Is it possible to develop hierarchical datagrid in VS 2008 without using any third party stuffs?

View 1 Replies

Hierarchical Directory Listing From A File

Jun 25, 2010

I'm trying to find an easy to create a hierarchical directory structure that I can put in a TreeView, with two caveats:

1) The file list is from a file

2) The paths are un *nix format (e.g. /dir/dir/file rather than c:dirdirfile)

I found this ([URL]) which would do what I want...if not for the two caveats above. I can go through the process of tokenizing the paths and start creating linked lists of objects for a directory structure, but before I do that I'd like to find out if anything else is available...

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved