Author Topic: RAWK Web Development Circle  (Read 118962 times)

Offline roscommonred

  • Anny Roader
  • ****
  • Posts: 475
  • No.5 was good
Re: RAWK Web Development Circle
« Reply #40 on: June 27, 2008, 05:35:52 pm »
Good thread this.

I have a problem that perhaps someone may help me with.

I'm using asp.net (VB) and SQL Server 2000.

I need to return data from the database (let's say a 10 field table) and be able to filter on any column at any time, exactly the same way as MS Excel works.

I can work by progressive filtering (eg select a product, then category, then item etc.) but thats not what I need here.

If you are familiar with how MS Excel filtering works then you can imagine what I'm trying to do. I have spent hours on the web looking for solutions but to no avail.

Hopefully the sharp minds of RAWK will serve me better.
After No.5 I said I didn't care if we never won another game. I was wrong.

Offline Mudface_

  • Boys Pen
  • *
  • Posts: 0
Re: RAWK Web Development Circle
« Reply #41 on: June 27, 2008, 06:32:03 pm »
Are these any help?

http://www.asp.net/learn/data-access/tutorial-07-vb.aspx
http://www.asp.net/learn/data-access/tutorial-08-vb.aspx
http://www.asp.net/learn/data-access/tutorial-33-vb.aspx

If not, I usually have a sort of search form above my list of data into which the user can input various criteria, then click a button to cause a postback and filter the data. Is that more like what you mean? If so, I might have some code knocking around on my PC here for that.

Offline Mudface_

  • Boys Pen
  • *
  • Posts: 0
Re: RAWK Web Development Circle
« Reply #42 on: June 27, 2008, 08:14:29 pm »
Found my code.

Stored Procedures-

Code: [Select]
CREATE PROCEDURE dbo.ProjectsSearch
(
@pageindex int,
@pagesize int,
@costcentreid int,
@employeeno int,
@stageid int,
@departmentid int,
@onstratplan int,
@title varchar(50),
@startdate datetime,
@enddate datetime
)
AS
SET NOCOUNT ON

SELECT * FROM
(
SELECT ProjectID, Title, CostCentreID, OnStratPlan, EmployeeNo, StageID, PercentComplete, DepartmentID, EntryDate, ManDaysRequired,
ROW_NUMBER() OVER (ORDER BY ProjectID) AS RowNum FROM dbo.ProjectDetails
) AS Projects
WHERE Projects.RowNum BETWEEN (@pageindex*@pagesize+1) AND ((@pageindex+1)*@pagesize)
AND (Projects.CostCentreID = @costcentreid OR @costcentreid = -1)
AND (Projects.EmployeeNo = @employeeno OR @employeeno=-1)
AND (Projects.StageID = @stageid OR @stageid = -1)
AND (Projects.DepartmentID = @departmentid OR @departmentid = -1)
AND (Projects.OnStratPlan = @onstratplan OR @onstratplan = -1)
AND (Projects.Title LIKE '%' + @title + '%' OR @title = '')
AND (Projects.EntryDate BETWEEN @startdate AND @enddate)


Code: [Select]
ALTER PROCEDURE dbo.ProjectsSearchCount
(
@costcentreid int,
@employeeno int,
@stageid int,
@departmentid int,
@onstratplan int,
@title varchar(50),
@startdate datetime,
@enddate datetime
)
AS
SET NOCOUNT ON

SELECT COUNT(*) FROM dbo.ProjectDetails
WHERE (ProjectDetails.CostCentreID = @costcentreid OR @costcentreid = -1)
AND (ProjectDetails.EmployeeNo = @employeeno OR @employeeno=-1)
AND (ProjectDetails.StageID = @stageid OR @stageid = -1)
AND (ProjectDetails.DepartmentID = @departmentid OR @departmentid = -1)
AND (ProjectDetails.OnStratPlan = @onstratplan OR @onstratplan = -1)
AND (ProjectDetails.Title LIKE '%' + @title + '%' OR @title = '')
AND (ProjectDetails.EntryDate BETWEEN @startdate AND @enddate)


DAL-


Code: [Select]
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;

/// <summary>
/// Summary description for SQLProjectsProvider
/// </summary>

namespace Projects.DAL.SQLClient
{
    public class SQLProjectsProvider : ProjectsProvider
    {

        public override List<ProjectDetails> GetProjectsBySearch(int pageIndex, int pageSize, int costCentreID, int employeeNo,
            int stageID, int departmentID, int onStratPlan, string title, DateTime startDate, DateTime endDate)
        {
            using (SqlConnection conn = new SqlConnection(this.ConnectionString))
            {
                SqlCommand cmd = new SqlCommand("dbo.ProjectsSearch", conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@pageindex", SqlDbType.Int).Value = pageIndex;
                cmd.Parameters.Add("@pagesize", SqlDbType.Int).Value = pageSize;
                cmd.Parameters.Add("@costcentreid", SqlDbType.Int).Value = costCentreID;
                cmd.Parameters.Add("@employeeno", SqlDbType.Int).Value = employeeNo;
                cmd.Parameters.Add("@stageid", SqlDbType.Int).Value = stageID;
                cmd.Parameters.Add("@departmentid", SqlDbType.Int).Value = departmentID;
                cmd.Parameters.Add("@onstratplan", SqlDbType.Int).Value = onStratPlan;
                cmd.Parameters.Add("@title", SqlDbType.VarChar).Value = title;
                cmd.Parameters.Add("@startdate", SqlDbType.DateTime).Value = startDate;
                cmd.Parameters.Add("@enddate", SqlDbType.DateTime).Value = endDate;
                conn.Open();
                return GetProjectDetailsListFromReader(ExecuteReader(cmd), false);
            }
        }

        public override int GetProjectsBySearchCount(int costCentreID, int employeeNo, int stageID, int departmentID, int onStratPlan,
            string title, DateTime startDate, DateTime endDate)
        {
            using (SqlConnection conn = new SqlConnection(this.ConnectionString))
            {
                SqlCommand cmd = new SqlCommand("dbo.ProjectsSearchCount", conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@costcentreid", SqlDbType.Int).Value = costCentreID;
                cmd.Parameters.Add("@employeeno", SqlDbType.Int).Value = employeeNo;
                cmd.Parameters.Add("@stageid", SqlDbType.Int).Value = stageID;
                cmd.Parameters.Add("@departmentid", SqlDbType.Int).Value = departmentID;
                cmd.Parameters.Add("@onstratplan", SqlDbType.Int).Value = onStratPlan;
                cmd.Parameters.Add("@title", SqlDbType.VarChar).Value = title;
                cmd.Parameters.Add("@startdate", SqlDbType.DateTime).Value = startDate;
                cmd.Parameters.Add("@enddate", SqlDbType.DateTime).Value = endDate;
                conn.Open();
                return (int)ExecuteScalar(cmd);
            }
        }
}

n.b. The ProjectDetails class is a simple, lightweight wrapper mapped to the Projects table. The SQLProjectsProvider class inherits from the abstract, generic ProjectsProvider class and is specific to SQL Server.


Part of the BLL-


Code: [Select]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Projects.DAL;
using Projects.BLL.LookUps;

/// <summary>
/// Summary description for Project
/// </summary>

namespace Projects.BLL.Projects
{

       [DataObjectMethod(DataObjectMethodType.Select)]
        public static List<ProjectList> ProjectsSearch(int costCentreID, int employeeNo, int stageID, int departmentID, int onStratPlan,
            int startRowIndex, int maximumRows, string title, string start, string end)
        {
            start = NullToEmpty(start);
            end = NullToEmpty(end);

            DateTime startDate;
            DateTime endDate;

            bool hasStartDate = DateTime.TryParse(start, out startDate);
            bool hasEndDate = DateTime.TryParse(end, out endDate);

            if (!hasEndDate)
                endDate = DateTime.MaxValue;

            if (!hasStartDate)
                startDate = new DateTime(1753, 1, 1);

            title = NullToEmpty(title);

            List<ProjectList> projects = null;
            string key = "projects_list_" + costCentreID + "_" + employeeNo + "_" + stageID + "_" + departmentID + "_" + onStratPlan + "_" +
                startRowIndex + "_" + maximumRows + "_" + title + "_" + start + "_" + end;
            if (Settings.EnableCaching && Cache[key] != null)
            {
                projects = (List<ProjectList>)Cache[key];
            }
            else
            {
                List<ProjectDetails> records = SiteProvider.Projects.GetProjectsBySearch(startRowIndex, maximumRows, costCentreID, employeeNo,
                   stageID, departmentID, onStratPlan, title, startDate, endDate);
                projects = GetProjectListFromProjectDetailsList(records);
                CacheData(key, projects);
            }
            return projects;
        }

        public static int ProjectsSearchCount(int costCentreID, int employeeNo, int stageID, int departmentID, int onStratPlan,
            int startRowIndex, int maximumRows, string title, string start, string end)
        {
            int count = 0;
            start = NullToEmpty(start);
            end = NullToEmpty(end);

            DateTime startDate = DateTime.MinValue;
            DateTime endDate = DateTime.MaxValue;

            bool hasStartDate = DateTime.TryParse(start, out startDate);
            bool hasEndDate = DateTime.TryParse(end, out endDate);

            if (!hasEndDate)
                endDate = DateTime.MaxValue;

            if (!hasStartDate)
                startDate = new DateTime(1753, 1, 1);

            title = NullToEmpty(title);

            string key = "projects_list_count_" + costCentreID + "_" + employeeNo + "_" + stageID + "_" + departmentID + "_" + onStratPlan + "_" +
                startRowIndex + "_" + maximumRows + "_" + title + "_" + start + "_" + end;
            if (Settings.EnableCaching && Cache[key] != null)
            {
                count = (int)Cache[key];
            }
            else
            {
                count = SiteProvider.Projects.GetProjectsBySearchCount(costCentreID, employeeNo, stageID, departmentID, onStratPlan, title,
                    startDate, endDate);
                CacheData(key, count);
            }
            return count;
        }
}


From the Web page-


Code: [Select]
    <div id="homepagemaindiv" style="font-size: 0.8em; border-bottom: none; background-color: Transparent;
        margin: 10px 1% 10px 1%; width: 98%;">
        <div class="homepageheader">
            Filter and Sort Options</div>
        <div class="homepagecontent">
            <table style="width: 100%;">
                <tr class="contentrow">
                    <td style="width: 25%">
                        Projects per page:
                    </td>
                    <td style="width: 25%">
                        Champion:
                    </td>
                    <td style="width: 25%">
                        Current Status:
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:DropDownList ID="ddlRecordsPerPage" runat="server" AppendDataBoundItems="True">
                            <asp:ListItem Selected="True">10</asp:ListItem>
                            <asp:ListItem>20</asp:ListItem>
                            <asp:ListItem>50</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlEmployees" runat="server" DataSourceID="odsEmployees" DataTextField="Name"
                            DataValueField="ID" AppendDataBoundItems="True">
                            <asp:ListItem Selected="True" Value="-1">(All)</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsEmployees" runat="server"
                            OldValuesParameterFormatString="original_{0}"
                            SelectMethod="GetEmployeesByDepartment"
                            TypeName="Projects.BLL.LookUps.Employee">
                            <SelectParameters>
                                <asp:Parameter DefaultValue="3" Name="departmentID" Type="Int32" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlStages" runat="server" DataSourceID="odsStages"
                            AppendDataBoundItems="True" DataTextField="Name" DataValueField="ID">
                            <asp:ListItem Selected="True" Value="-1">(Any)</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsStages" runat="server"
                            OldValuesParameterFormatString="original_{0}" SelectMethod="GetStages"
                            TypeName="Projects.BLL.LookUps.Stage"></asp:ObjectDataSource>
                    </td>
                </tr>
                <tr class="contentrow">
                    <td>
                        Allocated to cost centre:</td>
                    <td>
                        Allocated to Department Sub Group:</td>
                    <td>
                        On Strategic Plan?</td>
                </tr>
                <tr>
                    <td>
                        <asp:DropDownList ID="ddlCostCentres" runat="server"
                            AppendDataBoundItems="True" DataSourceID="odsCostCentres" DataTextField="Name"
                            DataValueField="ID">
                            <asp:ListItem Selected="True" Value="-1">(All)</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsCostCentres" runat="server"
                            OldValuesParameterFormatString="original_{0}" SelectMethod="GetCostCentres"
                            TypeName="Projects.BLL.LookUps.CostCentre"></asp:ObjectDataSource>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlDepartmentSubGroups" runat="server"
                            AppendDataBoundItems="True" DataSourceID="odsDepartmentSubGroups"
                            DataTextField="Name" DataValueField="ID">
                            <asp:ListItem Selected="True" Value="-1">(All)</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsDepartmentSubGroups" runat="server"
                            OldValuesParameterFormatString="original_{0}"
                            SelectMethod="GetDepartmentSubGroups"
                            TypeName="Projects.BLL.LookUps.DepartmentSubGroup">
                        </asp:ObjectDataSource>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlOnStratPlan" runat="server"
                            AppendDataBoundItems="True">
                            <asp:ListItem Selected="True" Value="-1">(All)</asp:ListItem>
                            <asp:ListItem Value="1">Yes</asp:ListItem>
                            <asp:ListItem Value="0">No</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr class="contentrow">
                    <td>
                        Title contains keyword or phrase:</td>
                    <td>
                        Between:
                    </td>
                    <td>
                        And:</td>
                </tr>
                <tr>
                    <td style="height: 25px">
                        <asp:TextBox ID="txtTitle" runat="server" Width="90%"></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="txtStart" runat="server"></asp:TextBox>
        <cc1:CalendarExtender ID="calEnd" runat="server" Format="dd/MM/yyyy" TargetControlID="txtEnd">
        </cc1:CalendarExtender>
                    </td>
                    <td>
                        <asp:TextBox ID="txtEnd" runat="server"></asp:TextBox>
        <cc1:CalendarExtender ID="calStart" runat="server" Format="dd/MM/yyyy" TargetControlID="txtStart">
        </cc1:CalendarExtender>
                    </td>
                </tr>
                <tr class="contentrow">
                    <td style="vertical-align: bottom" rowspan="2">
                        <asp:Button ID="btnShow" runat="server" Text="Show Records" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        <asp:Button ID="btnReset" runat="server" Text="Reset Filter" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="separator" style="margin-bottom: 20px; border: none;">
        </div>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True"
            AutoGenerateColumns="False" DataSourceID="odsProjects">
            <Columns>
                <asp:BoundField DataField="EntryDate" DataFormatString="{0:d}"
                    HeaderText="Date" HtmlEncode="False" SortExpression="EntryDate" />
                <asp:BoundField DataField="EmployeeName" HeaderText="Champion" ReadOnly="True"
                    SortExpression="EmployeeName" />
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title">
                    <ItemStyle Width="20%" />
                </asp:BoundField>
                <asp:BoundField DataField="CostCentre" HeaderText="Cost Centre" ReadOnly="True"
                    SortExpression="CostCentre" />
                <asp:CheckBoxField DataField="OnStratPlan" HeaderText="On Strat Plan?"
                    SortExpression="OnStratPlan" />
                <asp:BoundField DataField="Stage" HeaderText="Stage" ReadOnly="True"
                    SortExpression="Stage" />
                <asp:BoundField DataField="PercentComplete" HeaderText="% Complete"
                    SortExpression="PercentComplete" />
                <asp:BoundField DataField="Department" HeaderText="Department Sub Group"
                    ReadOnly="True" SortExpression="Department" />
                <asp:BoundField DataField="ManDaysRequired" HeaderText="Man Days Required"
                    SortExpression="ManDaysRequired" />
                <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID"
                    Visible="False" />
                <asp:HyperLinkField DataNavigateUrlFields="id"
                    DataNavigateUrlFormatString="projectdetails.aspx?id={0}"
                    NavigateUrl="~/ProjectDetails.aspx" Target="_blank" Text="Details" />
            </Columns>
        </asp:GridView>
        <asp:ObjectDataSource ID="odsProjects" runat="server" EnablePaging="True"
            OldValuesParameterFormatString="original_{0}"
            SelectCountMethod="ProjectsSearchCount" SelectMethod="ProjectsSearch"
            TypeName="Projects.BLL.Projects.Project">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlCostCentres" Name="costCentreID"
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="ddlEmployees" Name="employeeNo"
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="ddlStages" Name="stageID"
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="ddlDepartmentSubGroups" Name="departmentID"
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="ddlOnStratPlan" Name="onStratPlan"
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:Parameter Name="startRowIndex" Type="Int32" />
                <asp:ControlParameter ControlID="ddlRecordsPerPage" Name="maximumRows"
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="txtTitle" Name="title" PropertyName="Text"
                    Type="String" />
                <asp:ControlParameter ControlID="txtStart" Name="start" PropertyName="Text"
                    Type="String" />
                <asp:ControlParameter ControlID="txtEnd" Name="end" PropertyName="Text"
                    Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
« Last Edit: June 27, 2008, 08:18:22 pm by Mudface_ »

Offline Deano06

  • Confirmed BOFH TECHNOBORE#1
  • Anny Roader
  • ****
  • Posts: 425
  • Smarter than you.
  • Super Title: Or is he?
Re: RAWK Web Development Circle
« Reply #43 on: June 28, 2008, 03:52:24 am »
Good thread this.

I have a problem that perhaps someone may help me with.

I'm using asp.net (VB) and SQL Server 2000.


That is indeed a great problem ;)

Offline roscommonred

  • Anny Roader
  • ****
  • Posts: 475
  • No.5 was good
Re: RAWK Web Development Circle
« Reply #44 on: June 28, 2008, 05:15:51 pm »
Are these any help?

http://www.asp.net/learn/data-access/tutorial-07-vb.aspx
http://www.asp.net/learn/data-access/tutorial-08-vb.aspx
http://www.asp.net/learn/data-access/tutorial-33-vb.aspx

If not, I usually have a sort of search form above my list of data into which the user can input various criteria, then click a button to cause a postback and filter the data. Is that more like what you mean? If so, I might have some code knocking around on my PC here for that.


Thanks for posting. I've learned a lot from that site and done virtually every tutorial on it. I would call that progressive filtering though, which is not what I need. My data needs to be filterable on any field at any time though which the above doesn't help me with. Again, the best example I can give is the way you can filter in MS Excel.

I don't really want users to type a criteria in a search field (ease of use and error issues). I'd rather use dropdowns all the time. I guess my big problem is how to populate each dropdown with values from the returned dataset after filtering on one or multiple fields. I've found lots of people on the web asking how to do it , but no solutions yet....
After No.5 I said I didn't care if we never won another game. I was wrong.

Offline roscommonred

  • Anny Roader
  • ****
  • Posts: 475
  • No.5 was good
Re: RAWK Web Development Circle
« Reply #45 on: June 28, 2008, 05:17:13 pm »
That is indeed a great problem ;)

I'm beginning to think that. Maybe I should have stuck to being a barman.
After No.5 I said I didn't care if we never won another game. I was wrong.

Offline Bullan

  • I can't believe I ate the whole thing...
  • RAWK Supporter
  • Legacy Fan
  • ******
  • Posts: 3,583
  • Speed of The Sound Of Loneliness
Re: RAWK Web Development Circle
« Reply #46 on: June 28, 2008, 05:36:51 pm »
I mostly develop Custom Apps these days, alot of XML and data integration work as well as programming stuff for SMS and IP Solutions (CCTV and IP Telephone systems)
Using Triggers, Views , Stored and Extended Stored Procedures etc.
Have recently stared developing on the .Net platform using mostly VB.NET but being the saddo I am , have started learning C#.

I am very interested in learning about LAMP and AJAX , I´m proficient enough in Xhtml and all that lark, but the PHP and javascripting sides is where I am seriously lacking.
 
I hate every ape I see.
From chimpan-a to chimpan-z,
No, you'll never make a monkey out of me.
Oh, my God, I was wrong,
It was Earth all along.
You finally made a monkey...

Offline Deano06

  • Confirmed BOFH TECHNOBORE#1
  • Anny Roader
  • ****
  • Posts: 425
  • Smarter than you.
  • Super Title: Or is he?
Re: RAWK Web Development Circle
« Reply #47 on: June 28, 2008, 05:41:14 pm »
I'm beginning to think that. Maybe I should have stuck to being a barman.

PHP is so easy.

ASP is like you're fighting with your webserver to make anything happen.

Offline Mudface_

  • Boys Pen
  • *
  • Posts: 0
Re: RAWK Web Development Circle
« Reply #48 on: June 28, 2008, 07:57:04 pm »
Thanks for posting. I've learned a lot from that site and done virtually every tutorial on it. I would call that progressive filtering though, which is not what I need. My data needs to be filterable on any field at any time though which the above doesn't help me with. Again, the best example I can give is the way you can filter in MS Excel.

I don't really want users to type a criteria in a search field (ease of use and error issues). I'd rather use dropdowns all the time. I guess my big problem is how to populate each dropdown with values from the returned dataset after filtering on one or multiple fields. I've found lots of people on the web asking how to do it , but no solutions yet....

So basically, you'd want each of your filter dropdowns to only display current, filtered values from the associated column in your gridview?

I suppose you could bind the objectdatasource you're using to retrieve the data for your gridview to each of the dropdowns, binding the appropriate column for each to the dropdowns' DataTextField's. To get the unique values, you could then iterate through the data returned to each dropdown using LINQ (if you're on 2008/ framework 3.5), or a simple loop if you're on Visual Studio 2005 or earlier or don't want to use LINQ and then rebind the distinct data. I'm not sure what event you would use for that so it might take a bit of trial and error, and you'd want to be careful to avoid recursion if you're using a databinding event as rebinding the data should cause it to fire again.

If you're only returning a page of data at a time, then the above obviously won't work properly as you'd only get values for the columns on the current page- in that case, a possible solution would be to have procs for each of the columns using the same parameters as the gridview proc and link those to your dropdowns.

For example-

Gridview proc-

SELECT column1, column2... FROM dbo.YourTable
WHERE column1= @param1, column2= @param2....

Individual column procs-

SELECT DISTINCT column1 FROM dbo.YourTable
WHERE column1= @param1


SELECT DISTINCT column2 FROM dbo.YourTable
WHERE column2= @param2

etc

This obviously wouldn't be ideal as you'd be retrieving the data twice over, but shouldn't be too onerous if you're only doing a page at a time for the gridview and you've got a decent caching mechanism for the other procs.

PHP is so easy.

ASP is like you're fighting with your webserver to make anything happen.

Are you actually having problems with ASP.NET development, or do you just intend on throwing in snidey comments every few posts? If the former, then post them up and let's see if we can help. If the latter, then let us know so we're not wasting our time here.
« Last Edit: June 28, 2008, 08:06:46 pm by Mudface_ »

Offline roscommonred

  • Anny Roader
  • ****
  • Posts: 475
  • No.5 was good
Re: RAWK Web Development Circle
« Reply #49 on: June 28, 2008, 10:07:11 pm »
I suppose you could bind the objectdatasource you're using to retrieve the data for your gridview to each of the dropdowns, binding the appropriate column for each to the dropdowns' DataTextField's. To get the unique values, you could then iterate through the data returned to each dropdown using LINQ (if you're on 2008/ framework 3.5), or a simple loop if you're on Visual Studio 2005 or earlier or don't want to use LINQ and then rebind the distinct data. I'm not sure what event you would use for that so it might take a bit of trial and error, and you'd want to be careful to avoid recursion if you're using a databinding event as rebinding the data should cause it to fire again.

I think you're on the right track there. I'm still on 2005 so LINQ is not an option. I'm not sure what event I would use either, so I guess you're right about trial and error.

I think the way to go is loop throught each field in the gridview and append the unique values to the dropdowns each time there's a datachanged event. The thing is, I'm not sure yet how to loop through the gridview values. I'm sure there is a way somehow using something like ondatabound perhaps.

It seems like such a straightforward thing to do. I'm off work for the next week so I'll spend a bit of time playing with it then.

Thanks for putting a bit of thought into it, I really appreciate it.
After No.5 I said I didn't care if we never won another game. I was wrong.

Offline Mudface_

  • Boys Pen
  • *
  • Posts: 0
Re: RAWK Web Development Circle
« Reply #50 on: June 28, 2008, 10:33:54 pm »
There's OnRowDataBound- you would cast the gridview row to your data class, then retrieve the value from your column-

This is an example in C#

Code: [Select]
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                ThisAction action = e.Row.DataItem as ThisAction; // Cast to your own type
                if (action.RequiredDate < DateTime.Now && action.ActionStatus == Helpers.ActionStatus.Initiated.ToString())
                {
                    e.Row.Cells[5].CssClass = "overdue"; // Obviously do your own stuff here and add to the collection
                }
            }
        }
But I don't think you need that as you can just bind each of the individual columns to your dropdowns from your gridview data source.

Try plonking a dropdown on your web page, then choose its datasource as your gridview datasource, and allocate the DataTextField as the appropriate column.

If you do iterate through your gridview rows, then you'll still need to do the same sort of thing to provide unique values for your dropdown.
« Last Edit: June 28, 2008, 10:38:49 pm by Mudface_ »

Offline Ben S

  • Remember we were partners in crime. Pigeon Fancier. GTL Bus Freak. Also known as Bambi, apparently - or Miss Kitty on Wednesdays....
  • RAWK Staff.
  • Legacy Fan
  • ******
  • Posts: 32,269
  • Liverpool 5 - 1 London
Re: RAWK Web Development Circle
« Reply #51 on: July 1, 2008, 01:33:29 pm »
For sad people, graphs from RAWKS highest traffic day. Poor little server handled it quite well.

~4500 online (over 30 mins), which also at one point translated to 3800 over 5 mins and 2000+ over 1 min.




Offline PaulV

  • RAWK Pope
  • RAWK Supporter
  • Kopite
  • ******
  • Posts: 642
Re: RAWK Web Development Circle
« Reply #52 on: July 1, 2008, 01:39:47 pm »
Ben, what are you using to log this info and to produce the graphs?
To many people have discovered "Football Manager" and now they all think they are Kenny but alas so many end up as Roy

Offline Ben S

  • Remember we were partners in crime. Pigeon Fancier. GTL Bus Freak. Also known as Bambi, apparently - or Miss Kitty on Wednesdays....
  • RAWK Staff.
  • Legacy Fan
  • ******
  • Posts: 32,269
  • Liverpool 5 - 1 London
Re: RAWK Web Development Circle
« Reply #53 on: July 1, 2008, 01:41:36 pm »
http://serverstats.berlios.de/

Used to use cacti, which provided a better historical archive but was a resource hog.

Offline PaulV

  • RAWK Pope
  • RAWK Supporter
  • Kopite
  • ******
  • Posts: 642
Re: RAWK Web Development Circle
« Reply #54 on: July 1, 2008, 01:46:08 pm »
http://serverstats.berlios.de/
I am currently using munin, but I think I prefer these graphs
To many people have discovered "Football Manager" and now they all think they are Kenny but alas so many end up as Roy

Offline Deano06

  • Confirmed BOFH TECHNOBORE#1
  • Anny Roader
  • ****
  • Posts: 425
  • Smarter than you.
  • Super Title: Or is he?
Re: RAWK Web Development Circle
« Reply #55 on: July 1, 2008, 01:54:59 pm »
F*** IE 7.

Has anyone come across 'Webpage has expired' error randomly coming up when using a page after about 20 seconds.

Offline davetrousers

  • Boys Pen
  • *
  • Posts: 11
Re: RAWK Web Development Circle
« Reply #56 on: July 2, 2008, 09:17:15 am »
Hi all first time poster.

I have spent the last 2 1/2 years studying the sheidegger/skills train web design course,although i found it relatively easy to grasp most of it i really struggled with learning perl.I did manage to pass the module on it but only buy getting help from another student and a bit of editing.

Im 40 years old now and realise making decent money in this field is unlikley as i have no previous experience in this field and i cant get motivated to do the fnal exam because i found perl such a ball ache.

I wouldnt recommend anyone else going for this course,most of it you can learn online instead of paying £2500 for the qualification,does anyone think the qualification is worth it?

http://www.skillstrainuk.com/web-designer-CIW-course-details.html

Offline Deano06

  • Confirmed BOFH TECHNOBORE#1
  • Anny Roader
  • ****
  • Posts: 425
  • Smarter than you.
  • Super Title: Or is he?
Re: RAWK Web Development Circle
« Reply #57 on: July 3, 2008, 01:51:36 pm »
Hi Dave.

I'm totally self taught. I'd say get into a language that has a future such as PHP or ASP. Perl isn't really that widely used for new projects anymore just legacy stuff.

I'd say learn php because:

1) its very, very easy..almost too easy.
2) its installed on nearly every webserver
3) massive community support
4) loads of jobs in it.
5) its totally free as are most of the add-ons and extensions

Download WAMPserver (windows) or MAMP (on mac).

Get a decent PHP book. Peachpits visual quickstart you can find for £5 on ebay. I'd recommend that for a total beginner

Check out some PHP tutorials and become a master.


I would say a qualification is almost worthless in the web development industry for a few reasons.

1) there are no standards
2) the courses are usually rubbish
3) industry expierience/portfolio is 100000000000000x more of an indicator of skill/talent.
Good luck.

Feel free to private message me for guidance etc. I'm only 22 but I've got over 4 years industry experience, (3 solid and the last year as a Lead Developer) and know the business pretty well and I'm always happy to help others out.

Offline Deano06

  • Confirmed BOFH TECHNOBORE#1
  • Anny Roader
  • ****
  • Posts: 425
  • Smarter than you.
  • Super Title: Or is he?
Re: RAWK Web Development Circle
« Reply #58 on: July 3, 2008, 01:53:46 pm »
Awesome news
The new flash beta (10), appears underneath HTML elements now. Anyone who's worked with CSS drop downs *shudder* will appreciate this is very cool!

http://blogs.adobe.com/penguin.swf/2008/07/turkish_localization_also_wmod.html

Offline wacko

  • Keepsh a shecret gottle of Shcotch in hish top drawer. Cunning linguist and ical genius
  • Legacy Fan
  • ******
  • Posts: 5,205
Re: RAWK Web Development Circle
« Reply #59 on: July 3, 2008, 02:17:50 pm »
Awesome news
The new flash beta (10), appears underneath HTML elements now. Anyone who's worked with CSS drop downs *shudder* will appreciate this is very cool!

http://blogs.adobe.com/penguin.swf/2008/07/turkish_localization_also_wmod.html
It's about time they fixed that. Hate Flash.
Quidquid latine dictum sit, altum sonatur.

Offline Deano06

  • Confirmed BOFH TECHNOBORE#1
  • Anny Roader
  • ****
  • Posts: 425
  • Smarter than you.
  • Super Title: Or is he?
Re: RAWK Web Development Circle
« Reply #60 on: July 3, 2008, 02:28:46 pm »
Flash is fucking shit..When HTML5 is adopted it will be pointless.

Offline davetrousers

  • Boys Pen
  • *
  • Posts: 11
Re: RAWK Web Development Circle
« Reply #61 on: July 3, 2008, 04:36:14 pm »
Hi Dave.

I'm totally self taught. I'd say get into a language that has a future such as PHP or ASP. Perl isn't really that widely used for new projects anymore just legacy stuff.

I'd say learn php because:

1) its very, very easy..almost too easy.
2) its installed on nearly every webserver
3) massive community support
4) loads of jobs in it.
5) its totally free as are most of the add-ons and extensions

Download WAMPserver (windows) or MAMP (on mac).

Get a decent PHP book. Peachpits visual quickstart you can find for £5 on ebay. I'd recommend that for a total beginner

Check out some PHP tutorials and become a master.


I would say a qualification is almost worthless in the web development industry for a few reasons.

1) there are no standards
2) the courses are usually rubbish
3) industry expierience/portfolio is 100000000000000x more of an indicator of skill/talent.
Good luck.

Feel free to private message me for guidance etc. I'm only 22 but I've got over 4 years industry experience, (3 solid and the last year as a Lead Developer) and know the business pretty well and I'm always happy to help others out.

Thanks a lot for that mate i appreciate it,ive been on a web design forum and the lads on there said something very similar and that the qualification isnt that important and its more down to experience.Because of my age,i will probably just start by having a go at doing sites for family and friends until im confident enough to maybe charge money for one.I cant see making a living out of it...well not yet anyway maybe in a couple of years who knows?

Ill get that book you mentioned and have a go at php ,i could do with something new to get my teeth into.
« Last Edit: July 3, 2008, 04:38:00 pm by davetrousers »

Offline Degs

  • sy's midnight runners.
  • Legacy Fan
  • ******
  • Posts: 13,444
Re: RAWK Web Development Circle
« Reply #62 on: July 4, 2008, 03:35:51 pm »
For sad people, graphs from RAWKS highest traffic day. Poor little server handled it quite well.

~4500 online (over 30 mins), which also at one point translated to 3800 over 5 mins and 2000+ over 1 min.




Anything particular happen on that day?

Like we signed somebody or something.
Seems a bit weird lots of people rushing online at once.

Offline Mudface_

  • Boys Pen
  • *
  • Posts: 0
Re: RAWK Web Development Circle
« Reply #63 on: July 4, 2008, 03:42:32 pm »
Some ginger arsehole headed into his own net.

Offline Ben S

  • Remember we were partners in crime. Pigeon Fancier. GTL Bus Freak. Also known as Bambi, apparently - or Miss Kitty on Wednesdays....
  • RAWK Staff.
  • Legacy Fan
  • ******
  • Posts: 32,269
  • Liverpool 5 - 1 London
Re: RAWK Web Development Circle
« Reply #64 on: July 6, 2008, 07:16:22 pm »
Some ginger arsehole headed into his own net.

Offline LiamG

  • He's loving angels instead. Cos through it all they offer him protection.
  • Legacy Fan
  • ******
  • Posts: 12,144
  • Y.N.W.A
Re: RAWK Web Development Circle
« Reply #65 on: July 7, 2008, 08:38:12 am »
I know how to do a basic site, thats bout it!

Offline Slick_Beef

  • RAWK's Master Baker
  • RAWK Supporter
  • Legacy Fan
  • ******
  • Posts: 9,087
Re: RAWK Web Development Circle
« Reply #66 on: July 9, 2008, 07:18:07 pm »
Lads.. Need some advice ASAP. I've applied for a job today as a web programmer. I'm pretty much up to scratch on all the requirements for the job (PHP, Java, SQL etc), apart from two things-

ASP.net - I know standard ASP but, although I've read about .net and done some basics.. I've never developed a site with it.. I'm planning learn and practice tonight but could anyone outline some of the basic differences between asp.net and normal asp?

Ruby on Rails - Heard of this but I honestly have never come across it in my life. I see I can download the developer tools for free on their website so I'm doing that at the moment and planning to learn the basics but has anyone here used it? and if so, can you give me some ideas of what it's all about (i.e. is it similar to anything else I might already know) ?

Any help would be much appreciated!!

Offline Mudface_

  • Boys Pen
  • *
  • Posts: 0
Re: RAWK Web Development Circle
« Reply #67 on: July 9, 2008, 07:26:39 pm »
There's a brief summary of the differences here, in the middle of a basic tutorial. You can download Web Developer Express for free from here to have a play with, and there's some ASP.NET forums, tutorials, sandbox sites, starter kits etc here. This forum post here about ASP.NET interview FAQs might be useful for you as well.

Offline Mudface_

  • Boys Pen
  • *
  • Posts: 0
Re: RAWK Web Development Circle
« Reply #68 on: July 9, 2008, 07:27:56 pm »
Forgot to add, there's a specific ASP -> ASP.NET migration forum here where you might get some good snippets.

Offline Slick_Beef

  • RAWK's Master Baker
  • RAWK Supporter
  • Legacy Fan
  • ******
  • Posts: 9,087
Re: RAWK Web Development Circle
« Reply #69 on: July 9, 2008, 07:31:30 pm »
Thanks for that mate, that was lightning fast! I'll get reading...it's going to be a late night!

Offline Deano06

  • Confirmed BOFH TECHNOBORE#1
  • Anny Roader
  • ****
  • Posts: 425
  • Smarter than you.
  • Super Title: Or is he?
Re: RAWK Web Development Circle
« Reply #70 on: July 9, 2008, 07:39:22 pm »
Ruby on Rails is a framework that runs on top of Ruby specifically made for the web.

I wouldn't touch Ruby on Rails personally unless its for simple stuff because it's very slow (in terms of execution not development time). The framework is actually pretty good with a fairly steep learning curve.

If they want you to have this crazy broad skillset they're not going to expect you to be amazing at any of them.

Offline Slick_Beef

  • RAWK's Master Baker
  • RAWK Supporter
  • Legacy Fan
  • ******
  • Posts: 9,087
Re: RAWK Web Development Circle
« Reply #71 on: July 9, 2008, 08:02:51 pm »
Ruby on Rails is a framework that runs on top of Ruby specifically made for the web.

I wouldn't touch Ruby on Rails personally unless its for simple stuff because it's very slow (in terms of execution not development time). The framework is actually pretty good with a fairly steep learning curve.

If they want you to have this crazy broad skillset they're not going to expect you to be amazing at any of them.

Cheers mate. Just installed it actually so going to have a play about with it. One thing I like the sound of - it makes designing the style of the site a bit easier? Because I'm rubbish at that..I don't have an eye for colour schemes or anything, I'm just a programmer!

 I guess you're right about the skillset.. If it comes to an interview i'll play up my Java and PHP skills which is what I'm best at, but I always say I'm very willing and capeable of learning new technologies.. (kind of vital in the world of IT!). Would be good to know the basics of these things tho..

I'm making a site at the moment in preperation for me and the missus' wedding.. Having it so that guests can reply to the invitations online - let us know who they're bringing, who's allergic to what foods, that kind of thing.. and putting it all in an database so that they can modify it anytime. It's been great practice and has helped me loads in refreshing myself with SQL.

Offline Slick_Beef

  • RAWK's Master Baker
  • RAWK Supporter
  • Legacy Fan
  • ******
  • Posts: 9,087
Re: RAWK Web Development Circle
« Reply #72 on: July 9, 2008, 09:20:25 pm »
Update - Ruby on Rails is bollocks.

Would never use this out of choice but maybe I'm just pissed off having to learn the new syntax (never worked with perl or python or any of those that appear to be similar). I will keep at it nethertheless.
« Last Edit: July 9, 2008, 09:22:25 pm by Slick_Beef »

Offline wacko

  • Keepsh a shecret gottle of Shcotch in hish top drawer. Cunning linguist and ical genius
  • Legacy Fan
  • ******
  • Posts: 5,205
Re: RAWK Web Development Circle
« Reply #73 on: July 9, 2008, 10:05:28 pm »
Update - Ruby on Rails is bollocks.

Would never use this out of choice but maybe I'm just pissed off having to learn the new syntax (never worked with perl or python or any of those that appear to be similar). I will keep at it nethertheless.
Nah, it's a decent system, though it takes a bit of getting used to if you're not into Ruby.

Nevertheless, I won't go near it. Ruby unicode support is rotten and Rails is shite for multilingual apps.

I really can't understand how a framework can be so successful when it only works properly in one language (or rather ASCII).

Also, as Deano06 said, Ruby is godawful slow, even compared to Python.
Quidquid latine dictum sit, altum sonatur.

Offline Slick_Beef

  • RAWK's Master Baker
  • RAWK Supporter
  • Legacy Fan
  • ******
  • Posts: 9,087
Re: RAWK Web Development Circle
« Reply #74 on: July 9, 2008, 10:55:43 pm »
Nah, it's a decent system, though it takes a bit of getting used to if you're not into Ruby.

Nevertheless, I won't go near it. Ruby unicode support is rotten and Rails is shite for multilingual apps.

I really can't understand how a framework can be so successful when it only works properly in one language (or rather ASCII).

Also, as Deano06 said, Ruby is godawful slow, even compared to Python.

Only supports ASCII ? Bloody hell, hadn't read that. Can't imagine i'd need to do it much at this new job then seeing as I would be mostly working on portuguese apps which need accents and squiggles...
Anyway, i've decided to give ruby another go tomorrow, been working all day today so probably just not patient enough. I've just installed MS Visual Web Developer Express tho which looks pretty decent for a bit of free software. Doesn't half hog resources tho'!

Offline Deano06

  • Confirmed BOFH TECHNOBORE#1
  • Anny Roader
  • ****
  • Posts: 425
  • Smarter than you.
  • Super Title: Or is he?
Re: RAWK Web Development Circle
« Reply #75 on: July 10, 2008, 10:54:28 am »
Update - Ruby on Rails is bollocks.

Would never use this out of choice but maybe I'm just pissed off having to learn the new syntax (never worked with perl or python or any of those that appear to be similar). I will keep at it nethertheless.

well Perl is syntactically very, very similar to PHP (C type syntax). Pyhton is more like Ruby. You can use Pyhon like language-like constructs (endifs  instead of closing curly brackets etc) but they make code so f***ing unreadable it pisses me off so much.

Also when people write.

if(!$user) logout(); //SHIT.

instead of

if(!$user)
{
   logout(); //readable, standard
}

makes code really unskimmable by the human eye and is just s***.

just because you CAN do something..doesn't mean you SHOULD do something.

Funny ruby has such shit text encoding considering it's Japanese.

Doesn't half hog resources tho'!

That's because MS write software with Moore's Law in mind. Vista is  a perfect example: it just about worked on standard desktops when it came out but now nearly all computers can run it nicely (its still fucking shit though). Because MS like to ship software as quick as possible (seriously..) instead of optimizing it (as Steve Jobs said; Real Artists Ship,[look it up on folklore.org]). That's how they beat IBM. Even though I hate Windows I think it's actually a good business model. Unfortunately Moore's Law is becoming obsolete and MS are going to have to start optimising and refining their code more. 

Shit, I'm ranting again.

Umm where was I?

Yeah Rails, good framework. As I said: steep learning code unless you know Rails, MVC, Unix (MAKE/RAKE).

I wonder if iSmiff has anything to say on this matter?

Offline iSmiff

  • TECHNOBORE
  • RAWK Supporter
  • Legacy Fan
  • ******
  • Posts: 18,131
Re: RAWK Web Development Circle
« Reply #76 on: July 10, 2008, 11:07:03 am »
hold on till i go an ask one of the IT guys here what all that means and then i'll get him to tell me what to write

then i can impress people on the internet
STFU and agree with me.

Offline Mudface_

  • Boys Pen
  • *
  • Posts: 0
Re: RAWK Web Development Circle
« Reply #77 on: July 10, 2008, 11:12:33 am »
I'd suggest- "I couldn't give a fuck", Smiff.

Offline iSmiff

  • TECHNOBORE
  • RAWK Supporter
  • Legacy Fan
  • ******
  • Posts: 18,131
Re: RAWK Web Development Circle
« Reply #78 on: July 10, 2008, 11:20:32 am »
It's nice of dean to turn his thread into a slanging match ;D
STFU and agree with me.

Offline Mudface_

  • Boys Pen
  • *
  • Posts: 0
Re: RAWK Web Development Circle
« Reply #79 on: July 10, 2008, 11:27:31 am »
It's a shame as it could have been a decent thread, but I get the impression Dean's more interested in showing off and trolling than actually posting anything constructive. Bollocks to it.