How to fetch Last Record in Subsonic

Is it just me or is Subsonic the topic of discussion right now? I had a need to retrieve the last ID that had been generated in a table; that being, the last “auto increment” ID of a table. The following example worked a charm using Subsonic and activerecord. var fetch_ref_id = contract.All().OrderByDescending(c...

Subsonic ordering – OrderByDescending

So the subsonic documentation sucks. If you’re new to activerecord, linq and subsonic in general; you’ll find it fairly hard to construct basic queries. However once you’ve got it under control, it’s a piece of cake. To sort your table using activerecord, use the following examples; To...

SubSonic 3.0 ActiveRecord Tutorial

I wanted to demonstrate the complete and utter power of SubSonic Activerecord’s toolset. Pretty much, its an easy to use querying engine which automatically creates objects that you can use within your ASP.NET project. You can use LINQ querying if you like, or you can use the SubSonic preferred...

ASP.NET & AlternatingRowStyle & IE8

If you’re a ASP.NET developer like myself, you may or may not have noticed a few changes to your sites when viewed in Internet Explorer 8. As an example I had a gridview which had a different background for alternating rows. <AlternatingRowStyle CssClass="odd" /></code> And...

ASP.NETs Forms Based Authentication

Websites that offer membership based services often require their important files to be secured from non-members. For this purpose, they need to implement form based authentication that ensures that only members can access the files and even if a non-member copies the exact location of the file on the...

The GridView fired event PageIndexChanging which wasn’t handled

If you’ve set a gridviews AllowPaging attribute to “true”, you’ll notice the following error; The GridView fired event PageIndexChanging which wasn’t handled To setup paging with Gridviews, you also need to set the page index property to the new page that you wish to view....

Hiding Details view after update

I had the need to hide a detailsview after an update. Forget using visible=false, this just hides it permanently! Try setting the datagrid selectedindex = -1 protected void dvDetailsView_Updated(Object sender, System.Web.UI.WebControls.DetailsViewUpdatedEventArgs e) { gvGridview.SelectedIndex...

Weird scrolling issue with Modalpopupextender

Are you ripping your hair out over a issue with the AJAX modalpopupextender and a never-ending scrollbar?!? I had a panel with a style=absolute in the style= tag, causing the popup to show in the middle of the page. But for some reason, the page went wonky and I could scroll endlessly! Here’s the...

Using Windows Authentication under IIS7 (ASP.NET)

Okay so I took me a few hours but I finally figured out how to turn on Windows Authentication under IIS7. For some reason, it’s turned off by default and in IIS7 under authentication you’ll only see anonymous. I have a ASP.NET 1.1 application that requires Windows Authentication and this...

Check all function for Datagrids

I had the need to create a datagrid check all function, similar to those that you see in yahoo, gmail, hotmail etc. My Datagrid looked like this; <asp:datagrid id="dgList" Runat="server" width="600px" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn> <HeaderTemplate> <asp:CheckBox...

NullableTypes Access is denied

I came across a problem where everytime I recompiled my C# ASP.NET project and visited the website; it would report the following error. Exception Details: System.IO.FileLoadException: Access is denied: 'NullableTypes' I asked the developers for a fix and they came through with a quick and easy solution. First...

Adding sorting ability to a repeater control

This code snippet shows you how to sort a repeater web form control. This is handy when you are using scrollable repeater tables. DataView dv = ds.Tables[0].DefaultView; dv.Sort = "firstname asc"; rptUsers.DataSource = dv;

« Previous Entries