SQL Server :: Return Matches From 2 Different Bits Of Data In One Query?

Sep 29, 2010

i am writing a website that has a social networking element to it, and i want to display mutual friends of the person being viewed with the person that is viewing.

is it possible to search one database table and look for matching entries using 2 different usernames? if so how would i do it?

View 6 Replies


Similar Messages:

SQL Server :: How To Query Return All Data In Array Object / Collection Object

Sep 14, 2010

how to query return all data in Array Object ,Hash Table ,And DataTable dataRow

View 4 Replies

SQL Server :: Select Query Doesn't Return Values?

Oct 28, 2010

[Code]....

for some reason it doesnt return any values.

before i've added the inner join it worked perfectly.

i couldn't find my mistake, though i passed over it several times.

View 8 Replies

SQL Server :: Query To Return Results Based On Latitude / Longitude Within Certain Radius

Sep 7, 2010

I cant seem to find a good example of how to build the query logic. We are allowing users to search based on lat/long and need to add radius as another parameter. So you enter 29.30125 as the latitude and -95.04590 as the longitude and pick say 15miles as the radius, i need to return all records that fall within that radius.. can someone suggest a good site to review this type of query?

View 1 Replies

SQL Server :: How To Search For Possible Matches Of Word

Nov 11, 2010

I am not that good in SQL syntax and need some help. I am trying to create some search functionality for my website. Basically it just has to search for product names. Now I have a simple statement like SELECT * FROM Products WHERE ProductName LIKE '%' + @ProdName + '%' This statement does not fit to my requirements.I have 2 issues:

1. Assuming someone searches for "blocks". The result that I get is product names with the word "blocks" in it, however I would also like to display results with product names the have the word "block" in it i.e without the "s" In short I want to match the possible product names from the keyword e.g block, blocks, blocking etc I dont want it to search the exact name but may be just partially. If the keyword contains the exact word from the product name, well and good but it should also display the products where the keyword is partially matching.

2. Assuming someone searches for the words "concrete blocks". I get the result with products that have the words "concrete blocks" only. But I would also like to get the result with say "Louvre Blocks" in the total results displayed.So can someone kindly help me sort out my issues. Sorry if im repeating words but im just trying to make an understandable point.

View 5 Replies

Forms Data Controls :: How To Return Multiple Rows From A Query

May 18, 2010

I have the below c# method to populate an asp.net frontend control from a linq query. The only valid way I seem to be able to reference the query variable "result" is if I use the attribute "SingleOrDefault" but unfortunately this forces my query to return just the one single set of data for every unique primary key UserId value from my query, where I require the unique data attached to each different UserId value to be returned, how can I achieve this using linq? Note, I am passing the UserId value into my method from a public variable which is also below.

[Code]....

View 4 Replies

Architecture :: Ado.net Entity Framework - Query - Return Correct Data

May 26, 2010

I just tring to a complex (for me) with ado.net entity framework this is the structure: In practice it is a sort of group purchasing (Buyers) For each group of purchase (Buyer) should have the opportunity 'to select all products of the brands indicated in buyer I'm doing function to return correct data like this:

public List<Product> GetProductsByBuyer(int vBuyerId)
{
Buyersctx.Products.MergeOption = MergeOption.NoTracking;
return (from lProduct in Buyersctx.Products.Include("Brand").Include("Buyers")
where select lProduct).ToList();
}

View 2 Replies

SQL Server :: Query To Return Conditional Counts Both Distinct And Non Distinct?

Sep 30, 2010

I have the following table structure:

[code]....

The following query returns the default recordset:

[code]....

View 4 Replies

SQL Server :: DAL Doesn't Return The Return Value Of Stored Procedure?

Nov 8, 2010

I have an update function in my data layer which is defined as:

public int UpdateRBTable(parameters ...) This calls a SQL Server Stored Procedure to perform an update function on the database.

The process does its job for updating the table. However, the stored procedure has a return value (which indicates how many rows were updated), but this return value is not returned to the application. The application always shows that a zero was returned from the stored procedure.

View 3 Replies

Uploading Files In The Background (BITS / AJAX)?

Aug 24, 2010

I have a webpage where users can create a database record and select a file they want to upload to the database server. these files can be big, like 100mb.

I dont want the user to wait, so I want the file to be uploaded in the background. So that they can continue with doing other stuff while the file is being uploaded.

Is BITS the way to go for this? Or is that only for Fatclient development? Any good tuterials
?

If BITS is not the way to go, what are my options? An ajax call to a services with the filelocation?

View 2 Replies

C#: Preserving Bits Per Plane When Resizing Images?

Sep 27, 2010

I'm developing a service in which users can upload images and save them in a library. I want to preserve the original file (so people can upload high resolution images), but also make a copy of the image to use as a thumbnail.

The problem I have is that the thumbnail "weights" much more than the original file, proportionally. When I check the basic properties of each file (in XnView), I can see that the original files are for instance saved with 32 bits per Plane, whereas the source file will have, for instance, only 24 bits per plane.

What would be the correct way to make a copy of the original file while still using compression? This is an excerpt of the code:

private void ResizeImage(string originalFile, string NewFile, int NewWidth, int MaxHeight, bool OnlyResizeIfWider, string directory)
{
System.Drawing.Image FullsizeImage = System.Drawing.Image.FromFile(originalFile);
// Prevent using images internal thumbnail

[Code]....

View 2 Replies

ADO.NET :: SQL Query Inside Return URL?

Feb 8, 2011

I am trying to create a web service that will return a URL with a GUID at the end. It will look like this:

[URL]

However, the GUID will come from a database. What is the best way to do this? I tried using a Data Set but it would not let me append the Dataset to a string that I was trying to return. The return value was the web address with the Data Set appended to the end but I go an error.

View 1 Replies

.net - BITS Client Fails To Specify HTTP Range Header

Mar 8, 2010

Our system is designed to deploy to regions with unreliable and/or insufficient network connections. We build our own fault tolerating data replication services that uses BITS.

Due to some security and maintenance requirements, we implemented our own ASP.NET file download service on the server side, instead of just letting IIS serving up the files. When BITS client makes an HTTP download request with the specified range of the file, our ASP.NET page pulls the demanded file segment into memory and serve that up as the HTTP response. That is the theory. ;) This theory fails in artificial lab scenarios but I would not let the system deploy in real life scenarios unless we can overcome that.

Lab scenario: I have BITS client and the IIS on the same developer machine, so practically I have enormous network "bandwidth" and BITS is intelligent enough to detect that. As BITS client discovers the unlimited bandwidth, it gets more and more "greedy". At each HTTP request, BITS wants to grasp greater and greater file ranges (we are talking about downloading CD iso files, videos), demanding 20-40MB inside a single HTTP request, a size that I am not comfortable to pull into memory on the server side as one go. I can overcome that simply by giving less than demanded. It is OK.

However, BITS gets really "confident" and "arrogant" demanding files WITHOUT specifying the download range, i.e., it wants the entire file in a single request, and this is where things go wrong. I do not know how to answer that response in the case of a 600MB file. If I just provide the starting 1MB range of the file, BITS client keeps sending HTTP requests for the same file without download range to continue, it hammers its point that it wants the entire file in one go. Since I am reluctant to provide the entire file, BITS gives up after several trials and reports error.

View 1 Replies

SQL Server :: Get Return Value From Server In C# Through Data Reader?

Feb 5, 2011

I want to take my return value from sql server to c#.

my code

SQL SERVER:

ALTER procedure [dbo].[userss](@email varchar(100),@password varchar(25),@name varchar(250),@DOB varchar(20),@acc_vari int,@ip_address varchar(50),@vari_code varchar(7) )
as
begin
declare @uid int
select @uid=uid from users where email='12we'
if(@uid>0)
return 0
else
insert into users values(@email,@password,@name,@DOB,@acc_vari,@ip_address,@vari_code )
end

In this i want to take return value "return 0 " from sql server to c#.

View 3 Replies

Web Forms :: How To Handle Database Query Return

Jul 7, 2010

This issue has a few different facets so I wasn't sure what topic to post it in.I have a DB query like this:A SELECT statement with an INNER JOIN of two tables: [programs] and [program_managers] then on an aspx page ProgramManagers.aspx, I list the Project Managers, ordered by the Priority field of [programs].

I take the query and put it in a DataTable.Then I loop through the rows 1 by 1, creating Labels, etc to display the content.

Now here's the issue: Because a given Program Manager may manage more than one program, when I display this way, the Program Manager's Bio etc, gets listed as many times as their are programs that they manage.

[code]....

View 8 Replies

ADO.NET :: Creating Linq Query In Return Statement

Jan 18, 2011

[Code]....

[Code]....

creating Linq query in return statement

View 2 Replies

Return Anonymous Type From LINQ Query In VB.NET

Mar 25, 2011

I am consuming an RSS feed to display on my website using a repeater control. I was wondering if it's possible in VB to return an anonymous type from my linq query rather than a collection of strongly typed RSSItems. I know this is possible in C#, however haven't been able to work out a VB equivalent.

[Code]....

View 1 Replies

C# - Use XMLHttpRequest To Execute A SQL Query And Return The Results?

Feb 9, 2011

I'm building a web app for my company that will run a query every few seconds against SQL Server, and the data that it returns is which database is restoring and how much % complete it is. I have the query already set up and it works fine.

What I want to do is on my Web Form, have a "div" element that will contain the % complete of a database restore, and have it update every few seconds using the JavaScript timer object:

setInterval(function, interval)

I figure I would need to use XMLHttpRequest to send the request to the web server which will run the SQL query. Am I on the right track? How would I even start to do this?

My SQL query is below:

Use master
Select der.session_id, der.command, der.status, der.percent_complete, *
From sys.dm_exec_requests as der
Where percent_complete > 0

View 1 Replies

DataSource Controls :: Return First Value From A Linq Query?

Mar 12, 2010

Is there a way opf getting the first value from a linq query so for example

[Code]....

View 2 Replies

C# - Return Linq Query Into Single Object?

Mar 16, 2011

I have this code in my controller:

public ActionResult Details(int id)
{
using (var db = new MatchGamingEntities())

[code]...

View 3 Replies

Visual Studio 2010 - How To Execute SSIS 2008 64 Bits Package

Dec 30, 2010

I got VS2010 and SQL Server 2008 R2 64bit installed on a Windows Server 2008 R2, I need to execute a SSIS package from ASP.NET. From the research most people uses DTS, but it seems DTS does not support for 64bit, does anyone have a way make it working without using DTS?

View 1 Replies

SQL Server :: Can't Return Data Even In Particular Table?

Oct 1, 2010

I am new to Sql server 2005. I have a table in which contains many data. I need to take particular data. For example, I want to take value of 110652.795813712 from FTEBASEPAY column. So i have wrote the sql statment like in below. SELECT * From tblEmployees where FTEBASEPAY='53842.7782655718' But i am not able to get the particular value. Manually i have seen the tblEmployees table, in which contains the particular data ('53842.7782655718'). When i execute the above select statement, there is no result for it. What i have to for overcome this issue?I have to give one more information, the FTEBASEPAY dataType is float in tblEmployees table.

View 4 Replies

Return All Values From Table If Query String Is Empty

Jan 1, 2010

I have a page that lists products from a table based on the querystring. So if I say foo.aspx?fam=1 all the products from family 1 will be listed. How can I make my code list all the values if query string is empty? My SQL command would have to be different...can't really see how I can do this.

<asp:SqlDataSource ID="ds_produtos" runat="server"
ConnectionString="<%$ ConnectionStrings:LocalSqlServer2 %>"
SelectCommand="SELECT DISTINCT [IdProduct], [Name], [Description], [IdFamily], [Price], [Stock] FROM [Product] WHERE ([IdFamily] = @IdFamily )">
<SelectParameters>
<asp:QueryStringParameter Name="IdFamily" QueryStringField="fam" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>

View 2 Replies

DataSource Controls :: Return Unique Rows : T-SQL Query

Jun 11, 2010

I have an SQL database table like the following:

ID // Code // Shape

The ID is the integer identifier.

On one line the Code may be OX01 and shape Hexagon for example

Then the next line the code is still OX01 but the shape is Triangle.

What I want to do is be able to pull back data for every line that is equal to a unique Code column. in the above example OX01 Hexagon would be returned but not OX01 Triangle.

I've tried using SELECT DISTINCT but it brings back all records and doesn't filter them correctly.

I've considered having another column which could have Child/Parent data so that only the parent is returned but i'm sure there must be a better way of doing this.

View 2 Replies

DataSource Controls :: Check Query Return Value Or Not In LINQ

Jun 2, 2010

i have a Linq query that check something in database

after that i want to check if record find in database or not

dim re = From r in db.mytable _
where r.ID = _ID
Select r

how can i check the re return somthing or empty

View 1 Replies







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