Wpf - Linq Querying For User Search?

Mar 10, 2012

I am trying to query from search box using list of data and the linq I used is:data = (From k As BSPLib.ContactLib.Contact In data_org.Values Where k.stringdata Like "%" & Searchtxtbox.Text & "%" Select k.prime).ToListBut this is not working, I am getting no data at all. Data_org is a dictionary so I used the values; k.stringdata contains all the data that need to be searched. Searchtxtbox.text contains the user defined search item.I Tried with sqlmethods through linq, but sqlmethods does not exist for me, I tried with with Imported namespace yet the code is not showing sql methods, could you please provide a workable query or just tell me where I have gone wron

View 2 Replies


ADVERTISEMENT

Querying XML With LINQ By Attribute?

Mar 2, 2012

Given the following XML file:

<users>
<user name="admin" password="foobar" roles="Admin,Guest" />
<user name="guest" password="foobar" roles="Guest" />
</users>

How do I find a specific node? In this case I want to find the node that has its name attribute to be "admin"

Dim authGroup As XElement = XElement.Parse(myXMLDoc.OuterXml)
Dim foundUser As IEnumerable(Of XElement) = From i In authGroup.Elements Where i.Attributes("name") = "admin" Select i

[Code].....

View 2 Replies

(Linq To Datasets) Dynamic Querying In .net?

Jan 24, 2010

I have been looking into dynamic querying of datasets and the use of copytodatatable() for a project. I have seen in alot of forums that the copytodatatable functionality is unusable as it was removed. have an example of a dynamic Linq query being loaded into a datatable.

View 1 Replies

LINQ - Querying Top 5 With Rank Number?

Jun 29, 2010

How do I return a top 5 with rank number using linq?

Dim Top5 = From A In DAO.Cache.Select(Of VO.Empresa).Take(5) Select A.Nome

I would like this result:

Rank Name
1 "Example Name"
2 "Example Name"
3 "Example Name"
4 "Example Name"
5 "Example Name"

View 3 Replies

Querying An Array Of Invoice Objects (LINQ)?

Sep 19, 2009

I am having a little problem with some homework. Here is the problem:Use the Invoice Class provided to create an array of Invoice Objects. Class Invoice includes four properties- a PartNumber (type integer), a PartDescription (type String), a Quantity of the item being purchased (type Integer), and a Price (type Decimal). Write a Console Application that performs the following queries on the array of Invoice objects and displays the results:

[Code]...

View 3 Replies

Querying An Entity That Has A Varbinary Field With LINQ?

Jun 5, 2012

When I try to query an entity that has a varbinary field in it I am getting error:"The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities."

Here is my query:

Dim query = From entity In db.Entity
Where entity.Id= Id
Select entity.VarBinaryField

[code]....

The error gets generated when I check that the query isNot nothing.

View 1 Replies

VS 2008 - Querying Array Of Invoice Objects (LINQ)

Sep 20, 2009

Use the Invoice Class provided to create an array of Invoice Objects. Class Invoice includes four properties- a PartNumber (type integer), a PartDescription (type String), a Quantity of the item being purchased (type Integer), and a Price (type Decimal). Write a Console Application that performs the following queries on the array of Invoice objects and displays the results:

a. Use LINQ to sort the Invoice Objects by PartNumber
b. Use LINQ to sort the Invoice objects by Price
c. Use LINQ to select the PartDescription and Quantity and sort the results by Quantity
d. Use LINQ to select from each Invoice the PartDescrition and the value of the Invoice (i.e. Quantity * Price). Name the calculated column InvoiceTotal. Order the results by InvoiceTotal.
e. Using the results of the LINQ query in Pard d, select the InvoiceTotals in the range of $200 to $500

I am pretty sure I have parts a, b, & c completed correctly. Or at least the provide the desired results. Part d I figured out how to multiply the 2 fields but can't create a new column for the result or figure out how to show the PartDescription with the multiplied result. Part c I think I can figure out when I get part d. I already coded what I think will work for part c.

Below are the 2 Objects the Invoice was given and not to be changed & the LINQ is the one I have been working on.
Module LINQ
Sub Main()
' array of invoices
Dim invoices As Invoice() = { _
New Invoice("83", "Electric Sander", "7", 59.98), _
[Code] .....

View 3 Replies

ASP.Net (IIS 7.5) Querying Active Directory Without User Credentials?

Dec 20, 2011

I have multiple web applications that I've built for our intranet. I wanted to allow users to not worry about logging in, so these apps pull the currently logged on user when they hit the site. I used this code for this to happen:

Dim userName As String = User.Identity.Name
CurrentUser = userName.Substring(userName.IndexOf("") + 1)

This works like a charm, no issues here. The next step is to query Active Directory for that logged in user to pull various information. How I currently have it coded, it works like a charm on the devleopment side (typical because I'm not running IIS).The problem becomes when I publish it to my IIS server (Windows Server 2008 R2 running IIS 7.5), I get error messages that point to the specific line in my code that queries Active Directory. The interesting part is these apps were working great last week. They broke after my server admin did the latest batch of Windows Updates (please note, I am running them using .Net Framework 4.0)Before I had each app setup so that Windows Authentication was Enabled, the other Authentication types were disabled. For providers, Negotiate is #1, NTLM is #2. For Advanced Settings, Extended Protection = Off, and Enable Kernel-mode authentication is checked.

[code]...

In doing this I also removed the string that was higher up in my web.config section. This did not work either (fyi, this was a great reference[url]I then tripped across this article: [url] which seemed to be a similar situation. This article eventually referenced "Double Hops", after looking into this and trying a few things, this didn't solve my issue either.Next StepI am going to try a new IIS 7.5 implementation on a different Server 2008 R2 system and essentially start from scratch, to see if the problem recreates or not.

View 2 Replies

Build A Search The User Selects The Column Title And In Puts The Criteria Then Clicks The Search Button?

May 26, 2009

I'm in a bit of a quandry. I am trying to build a simple search form where the user selects the column title and in puts the criteria then clicks the search button. This is the code I am using

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
details = ComboBox2.Text
'column name selected by user
specifics = TextBox1.Text
'criteria input by user

[Code]...

View 9 Replies

Search Field, User Able To Press Enter To Search?

Oct 21, 2009

I have a search function in my app which is a groupbox with a textbox that contains the search keyword and a couple of radiobuttons. Do I have to create a keydown event for every single radiobutton and textbox? Or is there a better way? I tried making a keydown event for the groupbox but that didn't work.

If your interested, this is my

Private Sub Search()
Dim textBoxContents As String = txtBoxKeyword.Text
Dim keyword As String = Nothing

[code]....

View 2 Replies

Search Xml Using Linq?

Sep 24, 2009

<?xml version='1.0' encoding='utf-8' ?>
<All>
<Customers>

[code].....

View 3 Replies

C# - Search Two Columns In LINQ To SQL?

Apr 15, 2011

I am trying to make a simple search method using sql to linq in visual studio. In my database, i have the fields "Firstname" and "Lastname", and my search string is "name". How can i make a simple linq query which searches both fields?

in plain SQL i would do something like this: "SELECT (Firstname + Lastname) as 'Fullname' FROM table WHERE Fullname LIKE '%searchstring%'

View 3 Replies

C# - How To Search For Node Using LINQ To XML Query

Oct 14, 2009

Below the xml doc
<Root>
<Global>
</Global>
<local>
<section name="A">
<subsection name="A">
[Code] .....

Now I want the property1 whose section name="B" and subsection name="B" and innersection name="B" in one single query using linq to xml.

View 3 Replies

C# - Using LINQ To SQL To Search Entire Database?

Jul 7, 2010

Is it possible with LINQ to SQL to search the entire database (obviously only the parts that are mapped in the .dbml file) for a string match? I'm trying to write a function that will take a string of "Search Term" and search all mapped entities and return a List(Of Object) that can contain a mixture of entities i.e. if I have a table "Foo" and table "Bar" and search for "wibble", if there is a row in "Foo" and one in "Bar" that contain "wibble" i would like to return a List(Of Object) that contains a "Foo" object and a "Bar" object.

View 5 Replies

Linq To Xml - Unexpected Search Results

Mar 10, 2011

Just when I was thinking that I had Linq To Xml sussed I'm faced with yet another error! I think if I was to understand the linq search process in general better I might have more success, so any good links regarding that are also welcome. To my problem however; using the code below:

[Code]...

View 1 Replies

Mvc - LINQ Concatenate 2 Fields To Search On?

Jun 1, 2012

I'm trying to concatenate two fields in LINQ so that I can then filter with a keyword. I found a question posted here that I thought was my answer, but I'm getting 0 records back for some reason. This is supposed to return a JSON result for an autocomplete textbox (it works when I don't concatenate fields).

Here's my code:

[Code]...

View 1 Replies

XML To LINQ Start The Search From Root?

Oct 29, 2009

So far I don't got problems searching elements for example , the next block of code will load the xml file and then will search descendants ("recordinfomation") which is a parent element in the XML file and returns child elements ("title", "aut_FirstName, "aut_LastName, and "xmllink") . My question is I would like to start my search at the root of the xml file and search all parent elements and not a specific one and return what I am returning in the following code. In another words search the whole document for specific child elements.

Dim XDoc As XElement = XElement.Load(MapPath("App_DataBookstore.xml"))
Dim elements = From row In XDoc.Descendants("recordinformtion") _
Where Regex.IsMatch(row.Element("title").Value, strfirstterm,

[Code].....

View 1 Replies

DataGridView Cell Search Using A LINQ Query?

Jul 23, 2010

I have a VB.NET search routine, part of which is provided, below, that checks all Text cells in a DataGridView for a given string (inclusive), using a basic set of nested loops to perform the search:

' Search for the first occurrence of the given string
For Each row As DataGridViewRow In dgvMembers.Rows
' Skip the new row

[Code].....

is there a way to replicate this behavior using LINQ? Basically I would like the query to select (or return) the first DataGridViewCell whose text contains the search string. I've done some tinkering with sub-queries and the like, but I'm still having trouble wrapping my brain around the concepts (too many years of writing T-SQL, I guess).

View 2 Replies

LINQ To SQL Basic Column Search Doing OR / AND Of A List<string>?

Nov 23, 2011

Is there a way to check if a column contains all or any of an items in a list? Example "ABCDEFG" is my column value. "A" "C" "L" is my list stored in a list. I need to find rows that contains at least one item in my list. Then items that contains ALL the items in my list (a basic OR / AND search such as a SE would have)

View 1 Replies

VS 2010 Dynamically Building LINQ Query To Search Objects

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

C# - Search All The User Accounts In A Domain In .NET?

May 14, 2012

How do I search all the user accounts in a domain in .NET? Not the computer names in the domain, but the user accounts, that's what you are using to log on Windows.

View 3 Replies

Design A Routine That Will Allow The User To Search?

Dec 12, 2011

I am new to vb.net and am trying to design a routine that will allow the user to search for a record and return the results in a datagrid. Then double click on a row within the datagrid to view a more detailed form. I have been able to build the search form but am having problems with the double click event.I found a sample application on the Microsoft web site which is doing this on a smaller scale. The sample is built on the Northwind sql database and searches the customer table when you double click a row in the datagrid the following Microsoft code runs and opens a detailed form.

[Code]...

View 8 Replies

Search Entire Domain For A User In AD?

Apr 4, 2012

I understand how to find a user using the exact LDAP url

LDAP://domain/CN=Username,OU=Users,DC=domain,DC=com

but what if I need to find a user without looking in the particular OU. How do I search the entire domain?

View 2 Replies

VB Search Domain User For File

May 16, 2011

I am putting together an old post here with this new one. My main goal is to combine these two portions so that the search does not need to be ran on each and every computer.

[Code]...

I can set the path as WinNT://domain.name/username...and I get a list of something, are they files? i am not sure? Second portion of code searches the computer for the java.exe to display its version, as well as searching for any indication of a java file on that computer.

[Code]...

View 1 Replies

.net - SubmitChanges With LINQ To SQL And User Defined Functions?

Mar 7, 2012

On the SQL server I create a UDF. Let's name it fnCompanyDetails. It selects some information about a company from several joint tables.I then drag-and-drop this function in the new .dbml of my VB project. I want to use it with LINQ. Smth like this:

[Code]...

View 1 Replies

User To Be Able To Search It By Changing The Text Property?

Nov 8, 2010

I am looking for a code exmple. I have a data combobox and I want the user to be able to search it by changing the text property.

View 3 Replies

VS 2010 - Search On User Map And Put In Label Or Textbox?

Aug 7, 2010

How can I let VB search on the user map with the documents folder and stuff for the file named addon.exe then put it in a label or textbox?

View 13 Replies

Search For A Word Entered By The User In 40 Text Files?

Nov 2, 2011

I am building a search engine in vb.net which would have to search for a word entered by the user in 40 text files within the project directory. It should return the results as the total number of matches (text files) and the number of times this word is in each file.

View 5 Replies

Search Or Get User Data From Access Database (Tables)?

Apr 17, 2011

I have a form with 5 fields(inputs). When I entered data in the form and click submit, the data is entered into an Access 2007 Database(Table). All the set up (connection) is working because the data table is getting populated with the user info. However, I also need to search the database by entering a name in the name text box and clicking a button.

This is suppose to populated all the fields with information from the data base if the user exist. The search part is not working. I have no more hair to pull. :) Here is the code:

[Code]...

View 1 Replies

Use A Webbrowser Control For A User To Enter A Url And Perform A Search?

Aug 16, 2011

I have built a webcrawler where I use a webbrowser control for a user to enter a url and perform a search. Once the page is uploaded, my app grabs the HTMl and then with a button click convert it into plain text by using html agility pack (HAP). Finally by clicking a button I store the result inside a sql server database.

Now I want to use a background search system using the above control to perform the task which I am not able to figure out Basically say If I have a textbox where I enter the URL and it grabs the HTML then using HAP I have convert it into plain text and store it inside a database.Here is my code class for the normal search I carry out:

[Code]...

View 5 Replies







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