lamp

June 2009 - Posts

Nullable Types
30 June 09 02:28 PM | Frederick.Chapleau | with no comments

Tired to compare a string to empty, null , db.null and everything else just to find out if it's really null? Use a Nullable Type...

-f.

ref.:

http://msdn.microsoft.com/en-ca/library/1t3y8s4s.aspx

Filed under:
Deployment, and installation
29 June 09 02:24 PM | Frederick.Chapleau | with no comments

When it’s time to deploy an application, there is multiple options : xcopy, Click Once, NSIS, the publish option (for websites), and many others.

Check out and compare them before using a complex installer.

-f.

Filed under:
When you only want to return a file
28 June 09 03:11 PM | Frederick.Chapleau | with no comments

A new thing is ASP.NET 2.0: Response.TransmitFile, instead of redirecting to it (the browser must re-requesting a page), just transmit the file on the same connection.

-f.

About Webservices Names
27 June 09 05:11 PM | Frederick.Chapleau | with no comments

Ok, once again, if classes names of classes should not have the name class inside them, why Webservices should have “Service”, “Webservices” or “Service” in their names?

My hint on that, is that the name of the web services should relevant to its underneath system... like MembershipAccountManagement for a Membership System... So, when adding a reference to it, you have the system name in the automatically generated reference.

-f.

Filed under:
Use only one connection
26 June 09 11:10 PM | Frederick.Chapleau | with no comments

A connection can be open, and closed at each time, but a better way to use them is to open one, and query everything in the using.

Do not forget that you can only do that when you are NOT using Datareader! An exclusive connection is required in that case.

-f.

Filed under:
Debugging without Breakpoints
25 June 09 01:10 PM | Frederick.Chapleau | with no comments

A pretty old way to debug, is to output messages in a log file. The same kind of debugging is possible in VS2003 +, de console output.

And it’s possible to redirect this output when the code is compiled...

-f.

Filed under:
TCP/IP SQL Connection
24 June 09 12:53 PM | Frederick.Chapleau | with no comments

TCP/IP and Named Pipe can be used as SQL Connections, but when to use one or the other.

TCP/IP seams to be more efficient on slower network, and on fast one, both are comparable.

-f.

ref: http://msdn.microsoft.com/en-us/library/aa178138(SQL.80).aspx

Filed under:
ID, UID, GUID, UUID?
23 June 09 07:10 AM | Frederick.Chapleau | with no comments

What is the difference, when to use a ID, or a UID...

I don’t know, but here is my rule: An ID is automatically generated (like a Identity, or a GUID). A UID is generated by hand (like the unique id of an Account). A GUID is a type, so you never use it, you generate one. and a UUID is an Interface Type ID, so you do not use it too.

-f.

http://en.wikipedia.org/wiki/UUID

http://en.wikipedia.org/wiki/GUID

Filed under:
A NotNullAndNotEmpty test
22 June 09 06:12 PM | Frederick.Chapleau | with no comments

When testing if a string is empty, it’s always a good idea to test if it’s null too…

if(string !=null && string.Length>0) {}

Maybe it's a good case for a Extension Method?

-f.

Filed under:
AddWithValue, is it really good?
21 June 09 11:10 PM | Frederick.Chapleau | with no comments

Yes... This is a good question.

When you use AddWithValue, you just relying on the implicit SQL conversion between a nvarchar(4000) and the real datatype...

So, I’m returning the question to you: is it good, in your case?

-f.

Filed under:
Need a good database?
20 June 09 09:28 AM | Frederick.Chapleau | with no comments

Check out SQL Server Express, stability of SQL Server, without the licenses…

-f.

ref.:

http://msdn.microsoft.com/en-us/library/ms247257.aspx

Attach using connection string

Data Source=.\SQLEXPRESS;Initial Catalog=database;Integrated Security=True;

When an ImageMap is still usefull
19 June 09 05:58 PM | Frederick.Chapleau | with no comments

A map editor, all using Ajax, this is really impressive.

-f.

ref:

http://www.maschek.hu/imagemap

Filed under:
Need a good Gauge?
18 June 09 06:06 AM | Frederick.Chapleau | with no comments

Freely available, and maybe useful... sometimes.

All available from CodeProject (surprized?)

-f.

Ref.:

http://www.codeproject.com/KB/miscctrl/A_Gauge.aspx – Simple, but many types

http://www.codeproject.com/KB/GDI-plus/AquaGauge.aspx – Confort range enabled

http://www.codeproject.com/KB/miscctrl/ThermometerControl.aspx – Rely good reflection

Filed under:
IEnumerable and the yield statement
17 June 09 02:08 PM | Frederick.Chapleau | with no comments

Check out the yield statement when implementing the IEnumarable interface. You can interestingly return each values, and continue the to process... like a multiple “return”

-f.

ref:

http://msdn.microsoft.com/en-us/library/9k7k7cf0.aspx

Filed under:
using or not using
16 June 09 05:58 PM | Frederick.Chapleau | with no comments

From MSDN: “As a rule, when you use an IDisposable object, you should declare and instantiate it in a using statement.”

Simple.

-f.

ref:

http://msdn.microsoft.com/en-us/library/yh598w02.aspx

Filed under:
More Posts Next page »