Re: [DOTNET] Need a good real-world C# Exceptions Resource or Stategy for Library

2002-05-28 Thread Kirk Jackson
Sorry, I misunderstood what you meant by 'handling'. Yeah, I agree that the client should do any logging, rather than the library. Kirk -Original Message- From: franklin gray [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 29 May 2002 10:14 a.m. To: [EMAIL PROTECTED] Subject: Re: [DOTNET]

Re: [DOTNET] Need a good real-world C# Exceptions Resource or Stategy for Library

2002-05-28 Thread Kirk Jackson
With the libraries we create, we try to make the exceptions that a library client receives meaningful. This often means that we need to wrap up internal sql / xml / io exceptions into an UnknownPersonException (etc...) Also, we find it extremely useful to XML-Doc the exceptions that each method i

Re: [DOTNET] Hashtables and structs

2002-05-23 Thread Kirk Jackson
You can construct a Sorted List using your own IComparer, and then that can look inside the objects to determine the sort order on insert. Kirk -Original Message- From: Bill Conroy [mailto:[EMAIL PROTECTED]] Sent: Friday, 24 May 2002 4:19 a.m. To: [EMAIL PROTECTED] Subject: Re: [DOTNET]

[DOTNET] Attributes question

2002-05-16 Thread Kirk Jackson
Hi, I was looking at the "Attribute Based Validation" examples on the newtelligence website (http://www.newtelligence.com/news/AttributeBasedValidation.aspx), which made me wonder about how attributes work... I know that you can declare attributes on a class/member etc, and query the attributes

Re: [DOTNET] C# Nesting an If/Else inside of an If/Else???

2002-05-16 Thread Kirk Jackson
Does a printout of strResult actually show 'Doh.', or is it just the debugger looking like it is stepping into the else part of the if statement - sometimes the debugger can be misleading! -Original Message- From: Wareham, Matt [mailto:[EMAIL PROTECTED]] Sent: Friday, 17 May 2002 9:22 a.

Re: [DOTNET] ASP.NET Control - Insert text in here!?

2002-05-15 Thread Kirk Jackson
It's probably possible to extract the literal controls for the head tag, and replace them - see the thread titled "Extracting the Title of a Page from CodeBehind?" from the archives (early May) Kirk -Original Message- From: Zane Thomas [mailto:[EMAIL PROTECTED]] Sent: Thursday, 16 May 2

Re: [DOTNET] Winform Regex Validator and Multiline TextBox

2002-05-15 Thread Kirk Jackson
And I think it's annoying that this section of code is annoying: if (ValidatorTrim(value).length == 0) return true; Meaning that you need to put a required field validator as well as a regex validator, when the regex validator could easily do both. -Original Message- From: Michae

Re: [DOTNET] Winform Regex Validator and Multiline TextBox

2002-05-15 Thread Kirk Jackson
Yeah, I've found that the Jscript regular expressions (client side) don't support all of the syntax of the C# regular expressions (when a regex validator does a validate on the server side). I ended up having to turn off client-side validation in a couple of places, and in other places I split th

Re: [DOTNET] DataGrid limitation?

2002-05-14 Thread Kirk Jackson
You could do it in the SQL / Stored proc, truncating the field (so that the data isn't needlessly transferred), or you could do it in your databinding expression: <%# MaxLength(30,DataBinder.Eval(Container.DataItem, "Alias")) %> Where MaxLength is some function to trim the length of a string to

Re: [DOTNET] Hide part of code from Developers

2002-05-13 Thread Kirk Jackson
Presumably the reason you don't want to give out the Mappoint key is because they can use the key to perform requests that they can't do through your app. How about building a webservice 'proxy' that only exposes the behaviour that the application needs, and which in turn connects to the map-poin

[DOTNET] CSharp and optional parameters

2002-05-06 Thread Kirk Jackson
Hi, When using old DLL's from within C#, there are some methods that take optional parameters. In VB you can just leave those parameters out, but in C# it seems that you have to give values for every parameter, meaning that you need to figure out what each default value is (somehow!). Is this co

Re: [DOTNET] ErrorPage="url" clears Server.GetLastError() ?

2002-05-06 Thread Kirk Jackson
That's the behaviour I've seen. If you want to handle / log the error, you need to do it in the Application_onerror method, as the ErrorPage is just a client-side redirect. If you did want to display the error on the error page, you'd have to pass state around, either on the query string, or in

Re: [DOTNET] DateTime/Calender Questions

2002-05-02 Thread Kirk Jackson
And plus you can't assign null to a DateTime, because System.DateTime is a value-type. Kirk -Original Message- From: Marsh, Drew [mailto:[EMAIL PROTECTED]] Sent: Friday, 3 May 2002 5:48 a.m. To: [EMAIL PROTECTED] Subject: Re: [DOTNET] DateTime/Calender Questions Scott Densmore [mailto

Re: [DOTNET] DropDownList binding

2002-05-02 Thread Kirk Jackson
If you don't specify a DataTextField in the drop down list's properties, then I think it just defaults to calling ToString() on each Data Item. You probably also need a DataValueField. Kirk -Original Message- From: Dawid Greyvenstein [AST EH] [mailto:[EMAIL PROTECTED]] Sent: Thursday

Re: [DOTNET] From C# to VB.NET

2002-05-02 Thread Kirk Jackson
The reason 'using' is useful, is that you don't need to worry about an exception being thrown from your first dispose call (as if there is an exception, you'd still want to call cn.Close) Kirk -Original Message- From: Peter Stephens [mailto:[EMAIL PROTECTED]] Sent: Thursday, 2 May 200

Re: [DOTNET] Extracting the Title of a Page from CodeBehind?

2002-05-02 Thread Kirk Jackson
You could iterate through the controls of the page, looking for a LiteralControl that contains the and strings - but that's probably not the nicest way to do things! E.g. foreach (System.Web.UI.Control c in this.Controls) { if (c is System.Web.UI.LiteralControl) {

Re: [DOTNET] Submit by pressing Return - event?

2002-04-30 Thread Kirk Jackson
When ViewState is disabled on the grid, the values in it aren't remembered on post-backs. If you want the grid to be rebound on _every_ postback, even if there is no button clicked, then you'll have to do it in the page code (like Page_Load). The problem with Link Buttons, and any other button

Re: [DOTNET] Submit by pressing Return - event?

2002-04-30 Thread Kirk Jackson
Sounds like your datagrid has ViewState disabled, or you are DataBinding on every postback in your Page_Load method. Kirk -Original Message- From: João Pedro Martins [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 1 May 2002 7:13 a.m. To: [EMAIL PROTECTED] Subject: [DOTNET] Submit by pre