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


Post New Web Links

filtering table contents shown in datalist

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :ASP.Net
 

i am using this code to fill my datalist:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim myConnection As SqlConnection
        Dim myCommand As SqlDataAdapter
     
        myConnection = New SqlConnection("mydb")
      
        myCommand = New SqlDataAdapter("SELECT * FROM Posts", myConnection)
      
        Dim ds As DataSet = New DataSet()
        myCommand.Fill(ds)
     
        DataList1.DataSource = ds
        DataList1.DataBind()

    End Sub

it works and fills the datalist with the whole table..

when this page opens the address bar is like "www.example.com/threads.aspx?thread ID=123"

i would like the datalist to show all contents in the table with this specific thread ID.. thank you in advance :)




View Complete Post


More Related Resource Links

Filtering the Table of Contents Web Part

  
Hi there, I'm trying to filter the Table of Contents web part so that it only shows a list of sites; excluding the documents, lists, discussions, etc... This is on our projects site, and will be used to show a list of projects. I've scoured the net for quite some time and found some people trying to do the same kind of thing, but couldn't seem to get their custom xsl template to do the trick. I'm by no means an xslt expert, but I believe the answer lies in adding a custom style template that will filter the resultset in the LevelStyle.xsl file? Please help!!!

Filtering pivot table by KPI value

  
Hi, All ! I've been faced with following problem. I have a kpi that shows whether the dealer has send report in time. This KPI may return two values 1 - in time, -1 -  not in time. I built a simple pivot table in rows of which are dealer name, in column - KPI and in filter - month name. I'd like  to filter dealers by their status, to see only dealers, who haven't send report in time. I tried to filter in the pivot table by value, but without result. How I can doo it ? I thought may be worth  add a some attribute to dealer dimension that contain a KPI value and filter by this attribute ? Thanks in advance !

pushing 2columns of one table to another table after filtering(eliminating nulls & inserting only ip

  
hi thankz in advance,i have 2 tables t1 and t2in t1 i have 4 columns from that i want to insert only 2 columns to another table t2 i only want to send data which is in the form of ip adress like(123.123.123.123)after eliminating nulls and other data.plz suggest me is it possible to write a query or i need to do it programetically.thankz a lot..

inserting one table data to another after filtering nulls and duplicates

  
hi i have tbl_ip i want to filter nulls and duplicate to my tbl_ipfilter can u suggest me a stored procedure for this. data of tbl_ip is like below . ip 27.24.83.105 NULL NULL NULL 92.20.83.203 92.20.83.203 67.21.83.315

How to display the contents of a table while debugging a stored procedure

  

I see that after a call to my stored procedure I am jumping into a trigger while trying to insert rows. How do I see what SELECT * FROM INSERTED is or what is in other tables while I am debugging my stored procedure. (I know I can put SELECT * FROM INSERTED into my trigger, etc. but I am looking to be able to debug my stored procedure without changing anything except things in my debug environment.


Datalist with paging and filtering

  

hi my i'm gio. i have made site with datalist and i want to use SQL data  filteting and paging,my only problem is that i want to put filtering into paging procedure  

paging 1)

ALTER PROCEDURE dbo.GetProductsPaged
(
@startRowIndex int,
@maximumRows int
)
AS
SELECT     ID, Category, Type, Unit, MainImg, Price, Sale, Statu

Filtering on a DataList object

  

This seems like a stupid, basic question, but I can't find how to do it (plus I've been doing MVC and haven't done in webforms in ages now) - I've got a DataList object that hooks into an SQLDataSource object, and this works fine.  However I need to create a second DataList object for a slightly different set of criteria.  Rather than creating a second SQLDataSource object and thus calling the DB twice, I would like to make my SQLDataSource object return a broader set of results (this is easy as I am searching on a column, then each DataList is further filtering on another column) and then further filter these results on each respective DataList - how do I do this?

Thanks

MH 


Exporting to Word with table of contents

  

I was looking for functionality in SSRS 2008 that allows the creation of a table of contents when exporting to Microsoft Word.

I have not been able to find any examples and thought maybe I would have to use a 3rd party component.  Has anyone had experience doing this in SSRS and if so could you provide an example.

Thank you,

  


PlaceHolder contents not shown after PostBack

  

I have a GridView control which contains a custom <pagertemplate> with a <asp:PlaceHolder runat="server" ID="plcPages"> control.  The .aspx.cs file contains the following code:

    protected void Page_Load(object sender, EventArgs e)
    {

        ... {Other Code} ...


        GridViewRow pagerRow = GridView1.BottomPagerRow;
        PlaceHolder PagePlc = (PlaceHolder)pagerRow.Cells[0].FindControl("plcPages");
        Button btnPage;
        int iPageNum;

        for (int i = 0; i < GridView1.PageCount; i++)
        {
            iPageNum = i + 1;

            btnPage = new Button();
            btnPage.ID = "btnPage" + iPageNum.ToString();
            btnPage.CommandName = "Page";
            btnPage.CommandArgument = iPageNum.ToString();
 &

Quick Launch navigation and Table Of Contents Web Part multi language issues

  

I noticed that my multi language site have some issues in translations. The translations in breadcrumb, list and libraries are all ok, except the list names in the Quick Launch navigation and the Table Of Contents Web Part, it does not translate the names of lists and libraries......

Can anybody give me some advise? Or is this a bug?


webjc

How do I get a HelpProvider to start on the table of contents when it is run from the F1 key?

  

I have a .NET 3.5 application that runs a form's HelpProvider when the F1 key is pressed or when Help | View Help is selected from the menu bar.  When the form in initialized, the lines

            HelpProvider.HelpNamespace = HelpFileName;
            HelpProvider.SetHelpNavigator(this, HelpNavigator.TableOfContents);

In the form's properties, I have:

HelpButton                    true

HelpHavigator on Help   TableOfContents

are executed.  When Help | View Help is selected, the help file displays and opens to the table of contents tab.  When the F1 key is pressed, the help file displays, but it is not open to the table of contents tab.

 

What do I need to do to get the table of contents to be displayed when the F1 key is pressed?

 


How do I get a HelpProvider to start on the table of contents when it is run from the F1 key?

  

I have a .NET 3.5 application that runs a form's HelpProvider when the F1 key is pressed or when Help | View Help is selected from the menu bar.  When the form in initialized, the lines

            HelpProvider.HelpNamespace = HelpFileName;
            HelpProvider.SetHelpNavigator(this, HelpNavigator.TableOfContents);

In the form's properties, I have:

HelpButton                    true

HelpHavigator on Help   TableOfContents

are executed.  When Help | View Help is selected, the help file displays and opens to the table of contents tab.  When the F1 key is pressed, the help file displays, but it is not open to the table of contents tab.

 

What do I need to do to get the table of contents to be displayed when the F1 key is pressed?

 


viewing datalist data where from another table?

  

hi,

I am trying to show data on a datalist, but with some caveats.

1. WHERE the User Id = the querystring id pass on the url

2. WHERE the table 'resume', the 'permissions' column shows as '1'

or

WHERE the table 'resume' the 'permissions' column contains within it any number from 2-4, any of which matches one or more numbers in the 'permissions' column of the 'contacts' table (but WHERE the 'contacts' table where the url querystring id = column 'myuserid' and the signed in Profile.UserName = the column 'theiruserid'


Its complicted, but i dont know how to reference another data table when selecting data from the first table...?

Thanks if someone can help!



Problem filling labels with table data outside datalist using single call to db

  

On a single page, I'd like to fill 2 hyperlink controls as well as a datalist control with table data using one call to the database. The page looks like this:

<div id="PageContent">    
    <h2>
      Districts</h2>
    <p>
      Please select the district you wish to view below.</p>
    <p>
      <asp:DropDownList ID="ddlDistrict" runat="server" CssClass="textbox" 
        DataTextField="DistrictName" DataValueField="DistrictId" AutoPostBack="True" 
        onselectedindexchanged="ddlDistrict_SelectedIndexChanged">
      </asp:DropDownList>
    </p>    
    <p><asp:label ID="lblDistrictAbbrev" runat="server" Text="District Abbreviation: " />
      <asp:hyperlink ID="hyperlinkDistrictName" runat="server" 
        Text='' NavigateUrl="~/Contact/NationalCouncil.aspx" 
        Font-Bold="True" />
    </p>
    <p><asp:label ID="lblDistrictCouncillor" runat="server" Text="District Councillor: " />
      <asp:hyperlink ID="hyperlinkCouncillor" runat="server" 
        Text='' NavigateUrl="~/Contact/NationalCouncil.a

Filtering Page contents by User's City

  
I have set a profile column for WorkCity and would like to display news and weather specific to that user's home location no matter where he or she logs in.  I am doing this in SharePoint 2010 Standard and do not have Profile synchronization set up.  Is there any way to do this?

is there any way to create table of contents in rdlc ?

  

I am using rdlc in asp.net 2.0 .Is there any way to Create table of content in rdlc ?



my username not shown in reportserver.dbo.user table

  

I would like to change ownerID in a subsciption table from old dba to mine. But in report server dbo.users table I cannot find my username.

I tried all kinds of things like loging using my account to upload files from report manager, create me as a system user in SSMS reporting server, but my username just not shown up in the users table. I'm also a member of local administrators.

Why it is not shown up in the user table?

Please help, Thanks


SQLFriend
Categories: 
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