.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to return the results of a 1 to Many Relationship

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :ASP.Net
A co-worker of mine just came back from a SQL Server Reporting Services class (we are using SQL Server 2005). In that class they were told that if they had a one to many relationship that they would have to flatten the results into one row of the resultset in order to show the 'many' portion of the relationship.  For example, my company has two tables: Jobs Notes/Memo's For each Job we can have 0 or more Notes/Memo's. According to my co-worker the Report Server must have each of the Notes/Memo's in one row of the resultset.  That we therefore have to flatten the list of Notes into Note1, Note2, Note3...etc fields.  Is this correct?  How would I handle a situation where I didn't know how many Notes there were? Thanks so much.

View Complete Post

More Related Resource Links

Need Syntax To Make Results of LINQ Union Return Non-Generic Type



I have the below SQL which works just fine:

SELECT     Message, CreateDate, AccountId, AlertTypeId
FROM       dbo.Alerts
SELECT     TOP (100) PERCENT Status, CreateDate, AccountId,
                          (SELECT     10 AS Expr1) AS AlertTypeId
FROM         dbo.StatusUpdates
WHERE AccountId = PassedInParameter

I have been going about trying to convert the above into a LINQ method and am having problems with return types.
As the above SQL illustrates, I am querying two distinct LINQ tables - Alerts and StatusUpdates -
and then attempting to perform a Union on them. In order to do the union in LINQ, I have to have agreeing types. So, I
am using "var" to make the results of "alerts" and "updates" generic before the union.  

public IList GetStatusUpdatesAsAlertsByAccountId<T>(Int32 accountId)
            using (WorkbookDataContext dc = _conn.GetCont

Relationship between Search Results and permissions

Is it true that if your account did not have permission to a document library before a crawl occurred, you will not see it in a search result - even after you are given access to the documents? Here's a sequence of events to clarify the scenario: Crawl completed on DocLib1. User1 do not have access to DocLib1. No results when doing a search. User1 is given access to DocLib1. Question : Will User1 see the results when doing a search on DocLib1? Another Crawl completed on DocLib1. User1 will see the search results now on DocLib1. Does this mean a user must have access PRIOR to the crawl to be able to view it in a search? Anyone experience this scenario before? Thanks.

How to return looped procedure results so that they display as multiple rows of a single output inst


I understand that the below fragment will return a separate 1-row results set for each successful loop (also unnecessarily repeating the column header each time). How can I alter my procedure so that each value returned by the loop is appended underneath the previous value as multiple rows of a single results set? Do I have to store each return value in a temp table or someother storage object? It would be nice to just be able to spit them out row by row as each loop returned. Possible? Easy? Hard? I really appreciate the help I've received here so far.

SELECT (whatever)

OPEN techCursor;
FETCH NEXT FROM techCursor INTO @techNumLoop;
EXECUTE pr_FindExpenses4Tech @techNumLoop, @itemCount OUTPUT
SELECT @itemCount Item_Count

Search by file Name in advanced search does not return any results

Hi there ,when i search by file name it doesn't return any results . search by other columns return result.

keyword search doesn't return any results



Can anybody please help me with the whole issue of keywords definition?

Here is what I've got and do:

Sharepoint 2010 server and FAST Search server for Sharepoint 2010

I create site collection "A" using FAST Search center template

I enable SharePoint Server Enterprise Site Collection Features

In FAST Search Keywords section I define a keyword "M

different results return from .NET and sql query analyzer



Below is my code how to get the records from a stored procedure. I can get the correct results from sql query analyzer, but less results in .NET. Why it happened? How to solve it? Thank.

strSQL = "EXECUTE sp_Collection '" & strRECID &"','" & strPayPeriodFrom & "','" & strPayPeriodTo & "','" & intPayDays & "' "

objDB = DatabaseFactory.CreateDatabase()
            objDS = objDB.ExecuteDataSet(CommandType.Text, strSQL)

objDB = DatabaseFactory.CreateDatabase()

 objDS = objDB.ExecuteDataSet(CommandType.Text, strSQL)

*NOTE: connected to correct database

Compare/Join two lists and return results


I have a request to take two lists with similiar data, combine the data and display the results set differences.

List A:Serial:Hub

List B:Serial:Location

As an example I need to take and map the hub in list A (Lets say "Chicago") to the Location in List B (lets say "DEST.Chi") and find matching and missing serial numbers. There are 10 hubs and 10 locations that map to each other. Both lists are in the same site. Could someone point me in the right direction?




Fix it until it breaks!

People picker control is taking forever to return results



We have been having this issue across all SharePoint Sites in our organization from around a week. The People picker (people search control) control that gets the data from the available user profiles is taking forever to finish. It used to work with first few letters of the person's name but now it is not returning any data for first few letters, it is giving result back only if I type the full name of the person and that too is taking more than 5min to return. How can I fix this issue? All users are getting frustrated as this is most commonly used control in all lists, doc libraries etc.,

Thanks in advance.

created new user search doesn't return results


I created a new users by adding them to an AD group that is already in the site and has contribute access.  The user has the ability to login, add content, and everything the goes with contributing, but cannot search for content on the site.

The other users have no issue and when they search for something; for instance the location of something in the document library "new york" they receive results; however this user doesn't.  I also do not see the new user in the "All People" list.

Moss 2007 | SQL 2005 | 1 WFE

Any help is appreciate, thanks,

WSS 2.0 Search Failing to return results


I have a client with WSS 2.0 server with SQL 2005 that used to work until one fateful day in July when their relative decided to update the servers and work on them.

When searching for documents nothing is returned.  The mssearch service is started but I see three events logged to the SQL server regularly and whenever search is restarted.

The errors are:

vent Type:    Error
Event Source:    Microsoft Search
Event Category:    Gatherer
Event ID:    3028
Date:        11/3/2010
Time:        6:06:48 AM
User:        N/A
Computer:    SQL
The Gatherer object in project <SQLServer SQL0001200005> cannot be initialized. Error: 0 - The operation completed successfully.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 Event Type:    Error
Event Source:    Microsoft Search
Event Category:    Gatherer
Event ID:    3028
Date:        11/3/2010
Time:    &n

Search results does not return pdf documents


Hello Everyone,


I am building a custom search results page in which i am using FullTextSqlQuery for rendering the search results. I have installed IFilter of Adobe to render the pdf content into my search. i have gone thru the following links to do that.


Search is currently configured not to return more than 50 results for any query. You asked for resul


Hi All,


I was working on MOSS 2007 OOTB search no customisation.

Customisation of look and feel using XSLT.

My issue is i need to show only top 5o records on searchresults page each page should contain 10 items, i configured according to that in search core results webpart properties, but if i go to 5th page it is showing "next page" symbol if i click on it shows an error message:

"Search is currently configured not to return more than 50 results for any query. You asked for results starting from 51"

I shouldnt show next symbol @ 5th page ...how can i overcome this issue.



An Entity Relationship Diagram Example

An Entity Relationship Diagram conveys a lot of information with a very concise notation. The important part to keep in mind is to limit what you're reading using the following technique:

Choose two entities (e.g. Company and Employee)
Pick one that you're interested in (e.g. how a single Company relates to employees)
Read the notation on the second entity (e.g. the crow's feet with the O above it next to the Employee entity).

ListView DataPager with SQL-Statements that already return only paged data.



As far as I understand the ListView-Control and the DataPager-Control, they work like this: The ListView gets its datarows from its data source, then the DataPager causes the ListView to display only a subset of those rows.

So what, when I want to use custom databinding for the ListView, that *already* gets the certain subset from SQL-Server (for better performance). Can I and how can I use the DataPager then?

Thanx, S.

Good way to do a Many-to-Many relationship?


I've used the automatic  Many-to-Many generation as described here: http://msdn.microsoft.com/en-us/library/dd742359.aspx

But that doesn't seem to allow a quantity to be attached to orders (in the example it would be courses). I have many customers and many products, I would like a customer to be able to order more than one product. Right now I get a grid of checkboxes. I would like instead a field where I could enter a number. 

Is this possible?

sqlDataReader dos not get results


I am trying to run a stored proc from this function. When I run it thorugh the debugger I can see that myReader.HasRows = true and myReader.FieldCount =14.

But the control does not go in the loop while (myReader.Read()) where I am trying to read Version field returned by the stored proc.

Pls check me code and suggest correction. Thank You.

private static int Get_CaseInfo(string CaseNum)
            int Ver = 0;
            String myConn = ConfigurationManager.ConnectionStrings["DBConnectionString"].ToString();
            SqlConnection conn = new SqlConnection(myConn);
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = System.Data.CommandType.Text;

            SqlDataReader myReader = null;
            String stmt1 = "EXEC [REPORTS].[CaseInfoByCaseNo_Get] @CaseNo = '" + CaseNum + "'"; 
            cmd.CommandText = stmt1;
            cmd.Connection = conn;
                myReader = cmd.ExecuteReader();
                while (myReader.Read())
                    Ver = (int)myReader["Version"];

            catch (Exception)
            return Ver;         

XMLHTTP.ResponseText return unexecuted code?


I have a simple asp with the following code.  When I access this page directly (via browser) everything works fine:  the xml object shows up fine.  When I call this page via VBA (excel), the ResponseText method of the 

XMLHTTP object returns the below code unexecuted.  Anybody knows what's going on?  thanks.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <% Response.Buffer = True Response.ContentType = "text/xml" Dim oDataXML As Object 'Custom Data XML passed in by caller. On Error Resume Next 'Load the XML passed into the request. oDataXML = Server.CreateObject("Microsoft.XMLDOM") oDataXML.Load(Request) Dim sResult As String sResult = "<?xml version=""1.0""?>" sResult = sResult & "<OrderProcessed>" sResult = sResult & "<Status>test</Status>" sResult = sResult & "<OrderID>111</OrderID>" sResult = sResult & "</OrderProcessed>" Response.Write(sResult) Response.End() %>

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend