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

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

Showing Solr XML results in gridview using xmldatasource

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :ASP.Net
I have the XML below, generated by Apache Solr.I want to assign the results (2 <doc>nodes in this case) to a gridview using an XML datasource.<response>-<lst name="responseHeader">    <int name="status">0</int>    <int name="QTime">0</int>    <lst name="params">        <str name="facet">true</str>        <str name="fl">        id,title,city,score,location_rating,introtext,location_rating_total,themes,features,official,services        </str>        <str name="indent">on</str>        <str name="start">0</str>        <str name="q">*:*</str>        <arr name="facet.field">            <str>province_raw</str>            <str>services_raw</str>            <str>themes_raw</str>           &

View Complete Post

More Related Resource Links

XMLDatasource with gridview: only first result is showing

My gridview is showing only the first result from the data I have assigned to the XMLDatasource.This is this XML:<response>-<lst name="responseHeader">    <int name="status">0</int>    <int name="QTime">0</int>    <lst name="params">        <str name="facet">true</str>        <str name="fl">        id,title,city,score,location_rating,introtext,location_rating_total,themes,features,official,services        </str>        <str name="indent">on</str>        <str name="start">0</str>        <str name="q">*:*</str>        <arr name="facet.field">            <str>province_raw</str>            <str>services_raw</str>            <str>themes_raw</str>            <str>features_raw</st

Excel file not showing in search results

We have a strange issue. I have one Excel document (or at least one that I am aware of) that will not show up in search results for content within the document. I can find the document by title just fine, but when I search for words within the document I do not see it. The document was originally a 2003 Excel document and was recently converted to 2007. Other than that there isn't really anything unusual about it (some formatting stuff, but mainly just background colors and whatnot, nothing fancy). The crawl log shows the document was crawled without error. Anyone know anything else I can check on?

Showing the rows of a gridview as hyperlinks


Hi all, 
In the following code i have to continuing showing the rows of the gridview as links. For example: the user will click on a customer and will see more detailed information. Please suggest how to continue with an example. Thank you

    protected void Button1_Click(object sender, EventArgs e)
        //List<Customer> customersresult = new List<Customer>(); does not match the type here
        CustomerWebServiceClient.Customer[] cust;
        CustomerWebServiceClient.CustomerWebService client = new CustomerWebServiceClient.CustomerWebService();
        cust = client.GetCustomerContract(TextBox1.Text); //coming across now..
        //if (cust.va) validate if there is data
        GridView1.DataSource = cust;

// this is showing the gridview with the data coming. What would be next steps to show the rows as hyperlinks.

Thank you

gridview is not returning results..

Gridview is not being populated now that i built my objectdatasource in the code behind.. why. If i build the source on the aspx page and configure it that way, it returns results.. but when i try to build it in the code behind it just displays my empty template for the gridview.01.protected void btSearchDVR_Click(object sender, EventArgs e) 02.{ 03. if (ddlDVR.SelectedValue == "0") 04. { 05. rfvDVR.IsValid = false; 06. } 07. else 08. { 09. ObjectDataSource ObjectDataSource1 = new ObjectDataSource("DataAccessCode", "SelectDVRInfo"); 10. ObjectDataSource1.SelectParameters.Add("@dvrName", TypeCode.String, ddlDVR.SelectedValue.ToString()); 11. ObjectDataSource1.DataBind(); 12. 13. GridView1.DataSource = ObjectDataSource1.ID; 14. GridView1.Visible = true; 15. GridView1.DataBind(); 16. } 17.}  

Gridview not showing - Microsoft Web Developer 2010

I have a very simple web page. It was a grid View with a datasource associated with it which calls an SQL stored procedure. When creating the datasource, I tested it and it came back with results so the datasource work correctly. When I refresh schema for the Gridview, save the page and compile, the web page is blank. There are no errors. On the properties of the GridView Visible=true. I cannot understand why this is happening. Does anyone know of a reason why this would happen or how I could troubleshoot it further?

Group Results By Month, showing each month as the column

I have to list 50 states and the # of population per month. right now my results look something like..   CA, June, 5000 CA, July, 6000 CA, August, 7000 CA, September, 7230 I want it to show.. State, June, July, August, September CA, 5000, 6000, 7000, 8000 NJ, 4013, 5030, 7020, 7310   I was going to use a PIVOT table but.. I want the columns to expand as the coming month  comes upon us.

Gridview not showing alternate colors

I am trying to make the colors different for every line, so lets say one line white and the next light grey. I tried it in the gridview using autoformatting direct formatting css formatting but it has no effect on the display! The lines are all white! Only formatting to work is the header formatting. Who can help? For CSS, I have<RowStyle CssClass="gridRow" /> <HeaderStyle CssClass="gridHeaderSort" /> <AlternatingRowStyle CssClass="gridAlternateRow" /> and .gridAlternateRow {  background-color: #DCDCDC; /*LightGrey*/  } .gridRow {   background-color: White; } .gridHeaderSort { background-color: #DCDCDC; color: Black; font-weight: bold; text-align: left; }   I tried with every option - without any effect. Visual Studio 2005, IE6. No change in the preview, no change when running. I tried with a font option for the row - this one is evaluated. I tried setting it programmatically - no change.

Search results page showing random characters instead of item's description

I have an email-enabled document library that a few Japanese people email PDF files into (all external to the company). When I search for any PDF file sent from particular email addresses, the search results page displays random characters instead of the item's description. Here is an example: From Screen shots These characters don't appear for all email senders, just some of them. Our MOSS site is in English and we don't have any language packs installed. The PDF file contents are also in English. Can anyone point me towards a solution for this?

Search Results Web part not showing all results

Hello, I have an issue with the people search results web part not showing all the results that exist for a particular query. The query in question returns 106 results, and it is showing 50 per page, but the paging bar only goes up to page 2, and the results summary says it is showing "x of 100 results". If I manually change the query string to say start=61 instead of start=51 for page 2, it will show me the last 6 people, and the search summary will say "showing 57-106" Why is it not showing me the option for a page 2? When I perform a similar query that returns 140 results, it will show me all three pages correctly. I have tried turning duplicate trimming off but it makes no difference either. Any ideas why this is happening? Thank you

GridView Pager not showing proper number of rows

I have created an out-of-the-box  (default everything) ASP.NET Dynamic Data Entities Web Site using VS2010, C# and the .NET Framework 4. Created an ADO.NET Entity Data Model based off a MS SQL 2008 R2 database and registered that EF data model for my dynamic data. Everything works great except for the one change I would like to make. By default, the GridViewPager.ascx file provides the values 5, 10, 15 and 20 in the dropdown for GridView's "Results per page" option. I would like to change that to 10, 20, 30 and 40 - with 40 being the default selected option. I went to the code behind file and modified it to have the values I am wanting. Those values now show in the dropdown, and work if I select them. Problem: when the page is first rendered only 10 rows will show. How can I change this? Any help would be greatly appreciated.   Thanks

People search results showing members deleted from AD

Hi guysWe've configured a full nightly import of users from AD, but I'm seeing users who have been deleted showing up under the People Search function.  Does the import job delete accounts from SharePoint that no longer exist in AD?  If not, is there a way to change this?Tks,steven

gridview datakeynames with xmldatasource

I have this:<asp:GridView ID="gvSearchResults" PageSize="10" AutoGenerateColumns="false" DataSourceID="XMLDS" runat="server">    <Columns>        <asp:TemplateField>            <ItemTemplate>                <i>Name <%# XPath("str[@name=""introtext""]")%></i><asp:Button ID="ltbnCompare" Text="Compare" CommandName="Compare" CommandArgument='<%# XPath("str[@name=""id""]")%>' runat="server" />            </ItemTemplate>        </asp:TemplateField>    </Columns>    </asp:GridView>    <asp:XmlDataSource EnableCaching="false" XPath="response/result/doc" ID="XMLDS" runat="server"></asp:XmlDataSource>Now in the gvSearchResults_OnRowCommand I want to read the datakeynames for a row in which a button was clicked.But I need to reed several datakeynames, such as id, img and title.How can I put these

Gridview icw XMLDatasource :Databinding methods such as Eval(), XPath(), and Bind() can only be used


I want to get the value of an xpath expression in rowdatabound event. But I get:
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

<asp:GridView ID="gvSearchResults"  AutoGenerateColumns="False" DataSourceID="XMLDS" runat="server">
    Rating:  <%# XPath("float[@name=""location_rating""]")%>

<asp:XmlDataSource EnableCaching="False" XPath="response/result/doc" ID="XMLDS" runat="server"></asp:XmlDataSource>

Protected Sub gvSearchResults_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvSearchResults.RowDataBound
    Dim value As String = XPath("float[@name=""location_rating""]")
End Sub

showing the same data in gridview


in my page i have grid view and a add button which insert data in the grid view.  when a new user (a) open that page and add few items in the grid view, then another user (b) open that page from another computer, the grid view is filled with the item those the user (a) added. but what i want, user will have the grid view with empty. 

aspnet_regsql results not showing in administration



I'm trying to tie my login controls to my externally hosted database. I used the aspnet_regsql tool to create the appropriate tables in the database, but when I try to administer them through the "Administer Website" smart tag on the login control I cant connect to the new tables and such in the "Providers" tab.

Any ideas?

Mysite profile pictures not showing in people and groups, or search results

My organization is running MOSS 2007 Enterprise with search.  Picture profiles uploaded to the user's mysite only appear while browsing from the Default zone.  When browsing the Internet zone, a broken link appears in place of the picture when viewing pages such as "People and Groups" or search results.  For example:

Default zone:

http://moss1:5154   <---- mysite
http://moss1:5155   <---- main sharepoint site

Internet zone:

https://mysite.domain.com  <---- extended mysite
https://domain.com             <---- extended main sharepoint site

The picture profile url that is appearing while browsing the Internet zone is:


Instead of:


All of the textual information is coming over fine, just the images have invalid urls for the current zone.
Does anyone know how to fix this?

Any insights appreciated,


Exporting to spreadsheet showing no results

Hi guys,

I have a list that contains a few columns including calculated fields. When I export to a spreadsheet (via Actions => Export to Spreadsheet), I get the usual authentication prompt and thereafter the column headers appear but not the data. I don't have item-level security or anything fancy running on that list.

This is really confusing me. Has anyone had this problem?

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