Andrew Stevenson's WebLog

Write Here Write Now

Syndication

.Net Languages

ADO.Net

Asp.Net (Misc.)

Asp.Net Controls

Bad Patterns

Err What?

Files and Folders

Forums

IE Add-Ins

Methods for the Madness

Performance

See Clearer, C#

Test Driven

May 2005 - Posts

What the Hex is going on in the VS.Net 2003 debugger.

I probably need to reinstall the whole machine and put 2005 instead :P

I've been having this strange behavior in the 2003 debugger:

 All my integers are displayed as hex (mouse over and watch window) which is fine for small values like 1 and 2, but I don't have instant hex translation for 0x71.

Did I flip some little switch somewhere? I've been hexed

Posted Wednesday, May 25, 2005 9:12 AM by AndrewSeven | 3 comment(s)

The long and Binding Road

I'm looking at approaches that leverage Asp.Net's databinding abilities as an alternative to some object structures that serve almost only for "ease of" data binding.

I had made this happen before, probably with a typo, but had been unable to reproduce it.

I was trying this seemingly logical progression to bind a field that is deep inside:

<%#DataBinder.Eval(Container.DataItem,"ProductProperties")%> Gives DataSet
<%#DataBinder.Eval(Container.DataItem,"ProductProperties.Tables[0].Rows[0]")%> Gives DataRow
<%#DataBinder.Eval(Container.DataItem,"ProductProperties.Tables[0].Rows[0]['Description']")%> Still gives DataRow !? Nice quotes eh?
<%#DataBinder.Eval(Container.DataItem,"ProductProperties.Tables[0].Rows[0][0]")%> Still gives data row.
What gives? ;) I try a the ItemArray
<%#DataBinder.Eval(Container.DataItem,"ProductProperties.Tables[0].Rows[0].ItemArray[0]")%> Gives me the value. So something works, but I don't want to use indexes, the order will change.

<%#DataBinder.Eval(Container.DataItem,"ProductProperties.Tables[0].Rows[0].Item[0]")%> Wishfull thinking, not a property, compile error.

<%#DataBinder.Eval(Container.DataItem,"ProductProperties.Tables[0].Rows[0].[0]")%> Look at that dot! Bad dot, Good dot. It works

The final functional version:
<%#DataBinder.Eval(Container.DataItem,"ProductProperties.Tables[0].Rows[0].['Description']")%>

I guess that the databinder gets confused by the indexer, the extra dot seems to be the hint it needs to realize that the is annother level to look at.

Posted Monday, May 02, 2005 5:01 PM by AndrewSeven | 3 comment(s)

More Posts