February 2004 - Posts
I thought I'd post a solution to a debug issue I had today. I've had it before, and now I'll be able to google my blog for the solution.
When trying to debug a WinForms app, VS reports “The debugger is not properly installed. Run setup to install or repair the debugger.”'
This is pretty easy to fix. Close out VS, and open a command prompt.
Browse to %ProgramFiles%\Common Files\Microsoft Shared\VS7Debug
reregister each of the dll's (e.g. regsvr32 coloader.dll), and then run mdm and vs7jit with a /regserver switch (e.g. vs7jit /regserver).
Load up VS again, and it should be fixed.
I'm curious how other people do this. I can't figure out how to easily check the output of an SPROC which does a FOR XML. I tried copying the textual output to VS and then hitting the format code button, but there's some sort of wrapping issue, so the XML is invalid.
I learnt how to enable sorting on a datagrid with Viewstate disabled for the grid. Quite simple, actually - here's how:
You have to rebind on every page load, and manually put the SortExpression in Viewstate:
Sub Page_Load (sender as Object, e as EventArgs) Handles MyBase.Load
' Note that you CANNOT enclose in the usual If Not Page.IsPostback block!
myGrid.DataSource = myDataSet
myGrid.DataBind()
End Sub
Sub myGrid_SortCommand(sender as Object, e as DatagridSortCommandEventArgs)
Viewstate(“SortExpression“) = e.SortExpression
myGrid.DataSource = mySortedDataset
myGrid.DataBind()
End Sub
That's it! You'll, of course, find your page size to be much much smaller if viewstate is disabled on the grid.
More Posts