sexta-feira, dezembro 30, 2005

SQLSERVER 2005 - Transact-SQL Error Handling

Article from Carvin Wilson:
http://www.15seconds.com/issue/010312.htm
(In English)
Summary:

"OVERVIEW

The robust Transact-SQL (T-SQL) syntax in SQL Server provides developers with an efficient way to handle errors within stored procedures. This article discusses the @@ERROR, SP_ADDMESSAGE, and RAISERROR functions within SQL Server.

The @@ERROR Function

Upon the completion of any T-SQL statement, SQL Server sets the @@ERROR object. If the statement was successful, @@ERROR is set to 0, otherwise it is set to the designate error code. All SQL Server error codes can be found within the master.dbo.sysmessages system table. One important thing to remember is that @@ERROR is cleared each time a statement is executed. It is a good practice to store the value within a local variable.
"

quinta-feira, novembro 24, 2005

Store Commonly Used Code Snippets in the Toolbox

Store Commonly Used Code Snippets in the Toolbox
This tip comes in from Korby Parnell:

One of my favorite VS.NET productivity tricks is to store code snippets as toolbox items. Arguably, this trick is better for comments than code since you can't reference them. To add text to the Toolbox, highlight it in the code editor, drag it over to your toolbox, and drop it when the tooltip changes from the no smoking sign into rectangle. Thereafter, you can simply drag and drop the snippet to your editor for reuse.

Customizing VS.NET by 4GuysFromRolla

Store Commonly Used Code Snippets in the Toolbox

Store Commonly Used Code Snippets in the Toolbox
This tip comes in from Korby Parnell:

One of my favorite VS.NET productivity tricks is to store code snippets as toolbox items. Arguably, this trick is better for comments than code since you can't reference them. To add text to the Toolbox, highlight it in the code editor, drag it over to your toolbox, and drop it when the tooltip changes from the no smoking sign into rectangle. Thereafter, you can simply drag and drop the snippet to your editor for reuse.

Customizing VS.NET by 4GuysFromRolla

quarta-feira, novembro 23, 2005

Conferência no TAGUS PARK



Seminário GAPI

A informação, base do conhecimento, é um elemento determinante na sociedade actual, transmite-se à velocidade da Luz e é partilhável sem limites.

O conhecimento é desenvolvido a partir da informação que detemos e do investimento em actividades de investigação e desenvolvimento (I&D), que importa proteger.

O Estado, através do sistema de propriedade industrial, assegura a protecção destes investimentos, reconhecendo a sua autoria e impedindo a sua utilização indevida mas, em contrapartida, torna patente, ou seja, conhecidos, os resultados da investigação. Desta forma, divulgando mais informação suscita o desenvolvimento de mais conhecimento.

Interessa pois conhecer as fontes da informação, sua organização e formas de acesso, para se poder beneficiar deste excelente instrumento de apoio à inovação, que são as Bases de Dados da Propriedade Industrial.

Marcas, Nomes de Empresas e “Sites” são protegidos e registados por diversas entidades (INPI, RNPC, FCCN).

As Patentes, os Desenhos e os Modelos de Utilidade são também protegidos e registados no INPI. Trata-se de um sistema complexo agora apresentado de forma coerente neste seminário organizado pelo GAPI do Taguspark.

terça-feira, novembro 22, 2005

Add Line Numbers to Your Code-Behind Classes

Add Line Numbers to Your Code-Behind Classes

Did you know that you can add line numbers to your code files in VS.NET? Line numbers are especially helpful if discussing a block of code with someone else, as you can refer to a specific line numbers. To turn on line numbers, go to the Tools menu, choose Options, and from the left-hand side select the Text Editor / C# or the Text Editor / Basic options. In the right-hand side you'll find a "Line numbers" checkbox. Check this and line numbers will be added to your code files, as shown below.



Customizing VS.NET by 4GuysFromRolla

Customize the Start Page

How to customize the Start Page ?

When Visual Studio .NET loads up, by default the Start Page is shown, which lists the most recent projects. 4Guys reader Jon Vandermeulen writes in on how to tweak VS.NET so that more than just the default four projects are shown on the Start Page:

By default, your start page only shows the last 4 projects you worked on. But if you're like us, then you would routinely work on quite a few more than that. The setting is located in Tools > Options > Environment > General > Display ___ items in most recently used list.

Customizing VS.NET by 4GuysFromRolla

quarta-feira, novembro 16, 2005

META TAG no html-reference.com

This can be usefully for developers.

Try this example of webpage transactions:

< meta http-equiv="Page-Exit" content="revealTrans(Duration=1.0,Transition=23)" >

Note: Will do an random transaction from page. Don't work on Reload

META TAG no html-reference.com

quarta-feira, novembro 09, 2005

PRB: Memory allocated in an Windows Application/Windows Service

Some times is possible to lose some performance and the Windows Application/Windows Service can't release the Objects Memory and the Server will go down.

To avoid this:

Include Code:
Private Declare Function SetProcessWorkingSetSize Lib "kernel32.dll" (ByVal dwMinimumWorkingSetSize As Int32, ByVal dwMaximumWorkingSetSize As Int32) As Int32

Public Function NewSaveMemory() As Int32
GC.Collect()
GC.WaitForPendingFinalizers()
SetProcessWorkingSetSize(-1, -1)
End Function

Include Timer (5sec):

Private Sub TimerCleanMem_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles TimerCleanMem.Elapsed
NewSaveMemory()
End Sub


This functions will release the memory that are in the Garbage Collector

I hope this help

segunda-feira, novembro 07, 2005

PRB: Convert special chars to HTML compatible

This problem may occur when you want to put some special chars into WEB.CONFIG xml file of ASPX Web Applications:

- Solution: Substitute them with the HTML code

You can convert them directly in:

http://www-atm.physics.ox.ac.uk

sexta-feira, outubro 21, 2005

PRB: .NET Windows Service - "Sub Main was not found."

Include this following lines into:

Region " Component Designer generated code "

' The main entry point for the process
_
Shared Sub Main()
Dim ServicesToRun() As System.ServiceProcess.ServiceBase

ServicesToRun = New System.ServiceProcess.ServiceBase() {New SendSMS}

System.ServiceProcess.ServiceBase.Run(ServicesToRun)
End Sub

Now just need to compile again

segunda-feira, outubro 17, 2005

PRB: "The specified Web server is not running ASP.NET version 1.1" error message when you create an ASP.NET 1.1 application and you have both ASP.NET

PRB: "The specified Web server is not running ASP.NET version 1.1" error message when you create an ASP.NET 1.1 application and you have both ASP.NET 1.1 and ASP.NET 1.0 installed

http://support.microsoft.com/

Execute command:

(...)Microsoft.NET\Framework\v1.1.4322
[aspnet_regiis.exe -i]


ASP.NET 1.1, 32-bit version
To run the 32-bit version of ASP.NET 1.1, follow these steps:1. Click Start, click Run, type cmd, and then click OK.
2. Type the following command to enable the 32-bit mode:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
3. Type the following command to install the version of ASP.NET 1.1 and to install the script maps at the IIS root and under:
%SYSTEMROOT%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i
4. Make sure that the status of ASP.NET version 1.1.4322 is set to Allowed in the Web service extension list in Internet Information Services Manager.

http://support.microsoft.com/?id=894435

quinta-feira, setembro 29, 2005

InteractiveTvWeb.Org

Video/graphics integration

Many DTV receivers have a limited range of capabilities when it comes to supporting video and graphics. The HAVi UI model, with its separate devices for video, background and graphics, reflects these capabilities to some extent, but there are elements that digital TV developers need to be aware of. If you're not an experienced developer of STB software, these limitations may not be obvious at first.

A set-top box is not a PC

In a typical PC platform, video and graphics are all rendered in software (even if the video is decoded in hardware, the rendering is usually handled by software). This makes life easy when it comes to scaling and positioning video - since everything is done in software, the video is just like any other content that can be scaled, clipped and repositioned. Since it's just another piece of data to be rendered, it's easily integrated into the windowing system and coexists easily with the graphics as long as the host CPU is fast enough.

InteractiveTvWeb.Org

How to Secure Sql Server Communications

Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication

It is often vital for applications to be able to secure the data passed to and from a SQL Server database server. With SQL Server 2000, you can use SSL to create an encrypted channel. This How To shows you how to install a certificate on the database server, configure SQL Server for SSL and to verify that the channel is secure.

- MSDN

A Secure SQL Server

Microsoft SQL servers are one of the favorite targets for Internet hackers, primarily because of the activity of worms (e.g. SQL Spida, Slammer) spreading through this service, secondly because the access to unsecured, however Internet-connected SQL servers is quite easy. In this article I would like to describe the rules for safeguarding the Microsoft SQL Server service to help you, dear readers, prevent yourselves from the consequences of possible attacks.

- WindowSecurity.com