Skip to content

{ Category Archives } Work

SCOPE_IDENTITY across Linked Servers

You see…there’s this thing called “scope” and it apparently only applies to the server you’re calling SCOPE_IDENTITY from. Which does make sense in a “I just spent 3 hours fixing my code” kinda way. Wrote a few new stored procedures on the linked server that returned the identity as an output parameter, easy. [...]

Tagged , ,

.NET 1.1 browserCaps

I’ve been working with a series of Panel controls to hide and show various sections of a page. Since I’m actively trying to validate the pages, fix errors, and make sure it looks the same between IE and Firefox I happened to notice that the Panel control rendered as a table in Firefox instead [...]

Tagged , ,

ASP.Net DataGrid Sort Indicator

Talk about a pain. You’d think this would be easier….

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
private void Grid_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
{
DataGrid grid = (DataGrid)source;
grid.DataSource = CurrentView;
bool isAsc;
if (((DataView)grid.DataSource).Sort != e.SortExpression)
{
((DataView)grid.DataSource).Sort = e.SortExpression;
isAsc = true;
}
else
{
((DataView)grid.DataSource).Sort += " DESC";
isAsc = false;
}
 
//Loop columns to find sort
foreach(DataGridColumn col in grid.Columns)
{
//Clear header of previous images
col.HeaderText = col.HeaderText.Replace("<img src="http://john.rozeske.com/wp-admin/Images/SortDsc.gif" alt="Desc" class="sort" />","").Replace("<img src="http://john.rozeske.com/wp-admin/Images/SortAsc.gif" alt="Asc" class="sort" />","");
// [...]