Ctrl-Alt-Del on the Remote Desktop

29 09 2008

I wanted to change the admin password on my web server through remote desktop,
but Ctrl-Alt-Del always goes to the local computer.

I found out you can also use Ctrl-Alt-End to achieve the same thing, which works
in remote desktop.


Add Rows at runtime to Datagrid

21 09 2008


This document contains the sample code with explanation for adding rows to the datagrid at runtime using a button click event in .NET.


To add rows to the datagrid at runtime, the basic mechanism would be to add a dummy row to the dataset and then binding the same dataset to your Grid. After binding the dataset you need to control the behavior of the datagrid depending on your requirement by using it’s properties.

I will try to explain using a specific example.


We would be adding rows to the datagrid on a button click event with a requirement of having 5 rows on a one page and when you add the 6th row the control will be taken to second page.

One more thing when you add a row only last added row should be in Edit mode.

The code below shows a function that can be used to add blank rows to the first DataTable in any Dataset In this case, the first column in the Dataset that was used was a Primary Key and could not be blank, and I knew that the values from
the database would all be positive.

Code Snippet:

*****************************Code Begins***************************
‘Code below adds blank row and binds the datatable to the datagrid.
Private Sub add_rows()
querystring = “Your Query goes here”
cmdCodeMgmt.CommandText = querystring
daCodeMgmt.Fill(ds, “Table Name “)
dr = ds.Tables(0).NewRow
cnt = ds.Tables(0).Rows.Count
End Sub

*****************************Code Ends**************************** 


Problem with SQL Connection

7 09 2008

I came across this issua a couple of days back:

I use “Window Authentification” to sign on to “Microsoft SQL Server
Management Studio Express”. I create and account with “SQL Server
Authentification” and assigned a password. I also identify the database that
this ID has access to. When I then try to login with this id, I get a “Login
Failed for user ‘Kumar’. The user is not associated with a trusted SQL Server
Connection….Error: 18452”. I was wondering about why am I getting this error?

That is when I get a reply form Harish Ranganathan from Microsoft, that it was due to “Mixed Mode Authentication in SQL Server which was not enabled”.

This guy saved me a lot of time. Thanks Harish

Repeater Control – Tips

28 08 2008

My recent project had a requirement to change the class for every fifth element in the repeater. Though I wasnt able to find it widely on the net, the coding turned to be easier than  I had ever imagined. Here’s the snippet that i used in the ItemDataBound event of the Repeater control to set the class for every fifth element:

private void rptCollections_ItemDataBound( object sender, RepeaterItemEventArgs
e ) {
   if ( ( e.Item.ItemType == ListItemType.Item  e.Item.ItemType ==
ListItemType.AlternatingItem )
      && ( 1 + e.Item.ItemIndex ) % 5 == 0 ) {
      HtmlGenericControl divAddressItem = e.Item.FindControl( “divAddressItem” ) as
      divAddressItem.Attributes.Remove( “class” );
      divAddressItem.Attributes.Add( “class”, “lastItemCollectionItem” );

Performance Testing

15 08 2008

Hmm… you ever been into performance testing wherein, the application (you are testing) is dreadfully slow, padded with heavy processes and complex scenarios that cannot be efficiently automated? Well..i ve been and there is this one nice way of making it interesting.
Get your app loaded on the screen and along by, load the ever famous Helicopter (flash) game in a conveniently sized window. Now all you need to do is to fill up whatever test data that needs to be filled and get your app going. As you wait for the next screen to load, switch on to the other window and get the helicopter flying till the screen’s done loading in the background. Assuming the skill of flying the helicopter without crashing it till the next page loads to be congenital for a software engineer (in case not, guess it’s never too late to rear it, is it?), one can arrive at how slow the application has been based on how far the helicopter traveled.

Me’s sure that there are other ways too. Do share. 😉

Foundations of Ajax – book review

2 08 2008

I’ve recently completed reading “Foundations of Ajax” by Ryan Asleson and
Nathaniel T Schutta. This was the first book published, that I was able to
discern, on the subject of Ajax. I found the book to be very complete and
helpful and recommend it to those wanting to fully understand how to utilize
Ajax in their web apps.


CLR via C# – Jeffrey Richter

23 07 2008

By far, this one is my favorites.  Just 700 pages, this book could be considered The Bible of .NET development.  OK, maybe that’s a exaguration.  But it is a damn good technical reference.  If there’s a better way to express a certain syntax in C#, chances are good it’ll be demonstrated in this book. 
The book focuses on .NET Framework 2.0 and C# compiler version 8.0 while C# is used as demonstration language. There are Five parts covering:basics of the CLR execution model, describes the type system, the fundamentals behind designing types and members, working with essential types in .NET Framework and CLR facilities such as exceptions, automatic memory management, etc.

My recommendation to you is: you must buy and read CLR via C# if you are serious about .Net and would like to know how it works. This book explains the “behind the scene” details of .NET CLR. If you wan’t to know evertything about how the CLR internal are and works this is the right book.

P.S. If you are a developer and are pretty much serious about your career, just grab one of yours.