UrlBehavior

by Sander Gerz November 20, 2003 09:43

Here's something I found out today. Sure, it's been sitting in the helpfile, but I never saw it. There a property you can set with a webreference called UrlBehavior. The value of this property determines whether the URL of a Web reference is hard-coded into the generated Visual Basic or Visual C# proxy code.

When set to webrefUrlBehaviorDynamic, you can set the url of the webservice in the app.config file like this.

<configuration>
   <appSettings><add key="SomeProject.localhost.Service1"
      value="
http://localhost/SomeWebService/Service1.asmx"/>
   </appSettings>
</configuration>

No need to recompile your app. You learn something everyday.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Stored Procedures or not?

by Sander Gerz November 18, 2003 15:42

There's quite a discussion going on between Frans Bouma and Rob Howard on the benefits (or lack thereof) in using stored procedures in your applications compared to dynamic T-SQL statements. While our current company policy disallows the use of stored procedures, I'm still in favor of using it. Not for everything (like a simple select statement), but under certain circumstances a stored procedure can be quite compelling.

While others discuss the pros and cons, I usually refer to the almighty MSDN, where it says:

The benefits of using stored procedures in SQL Server rather than Transact-SQL programs stored locally on client computers are:

  • They allow modular programming.

    You can create the procedure once, store it in the database, and call it any number of times in your program. Stored procedures can be created by a person who specializes in database programming, and they can be modified independently of the program source code.

  • They allow faster execution.

    If the operation requires a large amount of Transact-SQL code or is performed repetitively, stored procedures can be faster than batches of Transact-SQL code. They are parsed and optimized when they are first executed, and a compiled version of the stored procedure remains in memory cache for later use. This means the stored procedure does not need to be reparsed and reoptimized with each use resulting in much faster execution times.

  • They can reduce network traffic.

    An operation requiring hundreds of lines of Transact-SQL code can be performed through a single statement that executes the code in a procedure, rather than by sending hundreds of lines of code over the network.

  • They can be used as a security mechanism.

    Users can be granted permission to execute a stored procedure even if they do not have permission to execute the procedure's statements directly.

The mere fact that Rob Howard inadvertedly used the word 'pre-compile' on stored procedures, Frans dismisses most of his other arguments. As always, I prefer the best of both worlds.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Visual Studio: don't alter html formatting

by Sander Gerz November 13, 2003 08:50

One of the more usual complaints about Visual Studio .NET is that it changes the layout of the HTML when switching back and forth between design and html view of a page. When it was shown that VS.NET 'Whidbey' does not touch the formatting, people started applauding (small number maybe, but that's not the point).

So when I was browsing through the Options of Visual Studio .NET 2003, I was a bit surprised to find that there is a setting where you can turn this autoformatting on and off yourself!

This seems to work fine. So how come we're all so happy for this feature in Whidbey? Seems to me that all they did was turn off the default setting.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET Saves Boy Down Well

by Sander Gerz November 02, 2003 20:40

Read all about it here!

 

Currently rated 1.5 by 2 people

  • Currently 1.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen | Modified by Mooglegiant