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

quarta-feira, setembro 28, 2005

Sql Server 2005 Roadshow - Resumo

Sql Server 2005 Roadshow - Resumo

Ontem no Roadshow de Sql Server 2005, os pontos mais importantes foram apresentados pelo Luis Silva da Rumos, que apresentou as duas sessões que estão em baixo:

- Scalabity

- Availability

Aqui ficam os scripts que serviram para a sessão:

- Scripts Sql Server 2005

Outro ponto que foi de interesse foi o facto do SqlServer 2005 trazer um software de desenvolvimento de DSS - Cubos, um gênero de Visual Studio Lite que, incorporado com o Visual Studio 2005 vai criar a possibilidade de termos vários tipos de projecto, incluindo BI - Business Inteligence...

Mais pormenores proximamente...

Developer Information Online: Channel9 at msdn

Developer Information Online: Channel9 at msdn

Este é um site feito para ter pequenos sketcs com dicas para programadores... Não deixem de lá dar uma volta...

Channel9

SQL SERVER 2005 and Visual Studio 2005 Online Library

SQL SERVER 2005 and Visual Studio 2005 Online Library

MSDN Library

Visual Studio 2005 Prerelease Software

Visual Studio 2005 Prerelease Software

Visual Studio 2005 and SQL Server 2005 were designed to help you build data-driven applications more easily and quickly than before. Order or download Visual Studio 2005 Beta 2 and experience the integration of Visual Studio 2005 and SQL Server 2005 for yourself. Visit the SQL Server 2005 page to learn more about that product.

VS2005

Get Ready for Visual Studio 2005 with Free* Microsoft E-Learning Courses and Clinics

Get Ready for Visual Studio 2005 with Free* Microsoft E-Learning Courses and Clinics.

Whether you are interested in creating Windows forms, building Web applications, implementing Data Access, or finding out about Visual Studio Team System, you can access the E-Learning topic you want, when you want it, and learn at your own pace. Each lesson includes hands-on virtual labs and offline functionality. These courses, valued at $99.00 each won't be free forever, so sign on today.

In addition, you may consider taking a free Microsoft Skills Assessment to help you meet your Visual Studio 2005 training goals. You'll receive a learning roadmap with additional skills resources including instructor-led classroom training and books. Take a skills assessment today.

For more information, visit the Visual Studio 2005 Learning Resources page.

VisualStudio 2005

Learn ASP.NET

Whether you are new to development or a programming veteran, we have taken some of the best ASP.NET learning materials and compiled them to help you learn ASP.NET quickly. Please select the link that best matches your current programming experience and you’ll find online training, sample code, free online books, and a number of other resources to help you learn ASP.NET.

MSDN

SQL Server 2005 New Features for Developers Virtual Workshop Session 1

SQL Server 2005 New Features for Developers Virtual Workshop Session 1

Virtual workshop brings the classroom to your desktop. You can now take courses from the convenience of your office or home, saving valuable travel time and expenses, while obtaining the benefits from live, instructor-led training!

Virtual workshops enable Hands-On learning Labs over the Internet by creating a virtual lab environment using Microsoft® LiveMeeting® running on Microsoft Virtual PC®, and replicated as many times as required on Microsoft Virtual Server®. To attend a virtual workshop, students require a phone line, a connection to the Internet, and the ability to download and run LLIFT and LiveMeeting (see system requirements for details). At the appointed time, all students and the instructor log in for the class. The instructor can view and control each virtual machine and, if desired, can also conduct private phone sessions with individual students. Virtual workshops enable the economical delivery of hands-on instructor-led training programs to remotely dispersed students.


Microsoft.com

quarta-feira, setembro 21, 2005

Visual Studio Team System on Tour Now!

Visual Studio Team System on Tour Now!
======================================
Agora a sua equipa de software pode colaborar mais eficazmente com uma grande inovação da Microsoft: Visual Studio Team System, uma plataforma de ferramentas do ciclo de vida do software que expande significativamente a linha de produtos Visual Studio. Descubra como pode reduzir a complexidade de fornecer soluções modernas e orientadas a serviços, aumentando a qualidade e previsibilidade dos projectos.

Esta apresentação ao vivo dá-lhe uma oportunidade única de beneficiar da informação em primeira-mão sobre este tema, bem como de partilhar e discutir as suas questões e experiências com peritos nesta área.

Informações Gerais sobre o Evento
=================================
Produtos: .NET Framework e Visual Studio.

Destinatários Recomendados: Arquitecto, Decisor Tecnológico, Profissional de TI e Programador.

Link para a página de registo do Evento Microsoft

terça-feira, setembro 13, 2005

Roadshow MS SqlServer 2005

Aumente a Capacidade de Gestão dos Seus Dados Empresariais

Benefícios Por Participar Neste Evento
- Sessões com conteúdos técnicos sobre o SQL Server 2005
- Entendimento das funcionalidades e tecnologias para a criação de um ambiente de bases de dados altamente disponível e escalável
- Como tirar partido das capacidades de Business Intelligence incluídas na nova versão para uma recolha e análise de dados rápida, eficiente e ao alcance de qualquer utilizador
- Conhecimento dos procedimentos de migração para SQL Server 2005

Quem Deve Participar
- Administradores de base de dados
- Administradores de sistemas
- Programadores
- Arquitectos de bases de dados e business intelligence
- Responsáveis por projectos de migração de base de dados

Link do evento na Microsoft

quarta-feira, setembro 07, 2005

WebServices - How to sort alfabetic the webmethods list

Look for file:
- C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\DefaultWsdlHelpGenerator.aspx

Look for line:
Hashtable methodsTable = new Hashtable();

Change to:
//Hashtable methodsTable = new Hashtable();
SortedList methodsTable = new SortedList();

And that's it. Your WebMethods List is sorted Alphabetic.

terça-feira, agosto 30, 2005

Format datetime variable type

.NET Framework Developer's Guide

Custom DateTime Format Strings
You can exercise greater control over how a DateTime object is formatted by using custom DateTime format specifiers to create your own custom DateTime format string. Combine one or more custom format specifiers to construct a DateTime formatting pattern that yields the output you prefer. In fact, most of the standard DateTime format specifiers are aliases for formatting patterns specified in the currently applicable DateTimeFormatInfo Class.

My Example:

// PPI: I need to format date like this "01/12 - 12:05", but (/) was replaced
// with (-) so I invented an formula :D
dteCreditDate.ToString("dd_MM - hh:mm").Replace("_", "/")



http://msdn.microsoft.com

http://www.experts-exchange.com

ASCII Table references

ASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation of a character such as 'a' or '@' or an action of some sort. ASCII was developed a long time ago and now the non-printing characters are rarely used for their original purpose. Below is the ASCII character table and this includes descriptions of the first 32 non-printing characters. ASCII was actually designed for use with teletypes and so the descriptions are somewhat obscure. If someone says they want your CV however in ASCII format, all this means is they want 'plain' text with no formatting such as tabs, bold or underscoring - the raw format that any computer can understand. This is usually so they can easily import the file into their own applications without issues. Notepad.exe creates ASCII text, or in MS Word you can save a file as 'text only'

http://www.lookuptables.com/

VB.NET Array usage

The following code shows how to declare an array in VB .NET. The value 10 gives the upper bound for the array. The lower bound is always 0 so this array contains 11 elements numbered 0 through 10.


Dim values(10) As Integer
As in VB 6, you can declare an array without bounds it. Later you can use ReDim to give it a size.
Dim values() As Integer
...
ReDim Preserve values(5)

Declare multi-dimensional arrays by separating the dimensions with commas.
Dim values1(9, 9) As Integer ' A 100 element array.
Dim values2(,) As Integer ' No bounds yet.
ReDim values2(9, 9) ' Give it bounds.

If you declare an array without bounds, you can initialize it during the declaration. Put the array items inside parentheses, separated with commas. The system automatically figures out what dimensions to use.

' An array with three values,
' indexes 0 through 2.
Dim values() As Integer = {1, 2, 3}

To initialize an array of objects, use the object constructors inside the value vector.
Dim primary_colors() As Pen = { _
New Pen(Color.Red), _
New Pen(Color.Green), _
New Pen(Color.Blue) _
}

For multi-dimensional arrays, put values for an array of one fewer dimensions inside more parentheses and separated by commas.
' A 2-D array with six values,
' indexes (0, 0) through (1, 2).
Dim values(,) As Integer = { _
{1, 2, 3}, _
{4, 5, 6}}

' A 3-D array with 12 values,
' indexes (0, 0, 0) through (1, 1, 2).
Dim values(,) As Integer = { _
{{1, 2, 3}, _
{4, 5, 6}}, _
{{7, 8, 9}, _
{10, 11, 12}} _
}

http://www.vb-helper.com

sexta-feira, agosto 12, 2005

Security Clinics & Labs

Security Clinics & Labs

Learn on your own schedule.
At your own pace.
In your own office.

Our free Microsoft® Security E-Learning Clinics follow the same content outline as our Security Webcasts, but deliver that information via a learner-centered format that offers unique user benefits. With an E-Learning Clinic, you can access the security topic you want, when you want it, and learn at your own pace. Each lesson can be paused, and all security topics are indexed for fast and easy repeat use. So sign on today for an E-Learning Clinic, and get free information that can help you better protect your organization against security threats.

In addition to E-Learning clinics, we also offer free Microsoft Official Hands-On Labs Online where you can perform security-related procedures in a safe, networked environment powered by Microsoft Virtual Server technology. Hands-On labs let you see for yourself how to implement the security best practices discussed in the clinics.

Microsoft Security Hands-On Labs are also offered for free at participating Certified Partners for Learning Solutions. For these and other security training options, please visit the Security Program Guide.


https://www.microsoftelearning.com/security/

Using the New Visual Studio 2005 Report Controls

Using the New Visual Studio 2005 Report Controls

Want to add rich data reports to your Windows applications? Brian Welcker shows how the new report controls in Visual Studio 2005 make it easy to embed managed server reports or build and embed local reports into your Windows Forms application.

"http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20050616SQLServerBW/manifest.xml

terça-feira, junho 07, 2005

LDAP - User Validation

Public Function ValidateLDAPLogin(ByVal strUsername As String, ByVal strPassword As String, ByVal strLDAPServerIP As String) As String
Dim entry As New DirectoryEntry("LDAP://" & strLDAPServerIP & "/rootDSE", strUsername, strPassword, AuthenticationTypes.Secure)
Try
Dim strName As String = entry.Name ' PPI: This is one simple try, if failed, User isn't
Return ConfigurationSettings.AppSettings("strResponseOK")
Catch ex As System.Runtime.InteropServices.COMException
Return ex.Message
End Try
End Function

segunda-feira, abril 11, 2005

CodeSmith - New Version (Code AutoCreator - DB and App)

A CodeSmith 3.0 public beta is now available for testing. This is a major new version of CodeSmith and includes a lot a great new features. Your help in testing this build and providing feedback is very much appreciated.

Here is a summary of what's new:
- Completely re-written parser/compiler which is faster and correctly reports line numbers from the template instead of from the compiled template source. This results in a much nicer debugging experience.
- XML support - There is now an XmlProperty directive that makes working with XML MUCH easier. This directive will give you a strongly typed object model to work with if you provide an XSD schema or it will give you an XmlDocument instance if you don't. This feature combined with the new IntelliSense feature make working with XML a breeze.
- IntelliSense in CodeSmith Studio.
- Template caching.
- New Register directive that makes working with sub-templates much nicer.
- Console client has been improved to include a batch mode, setting properties from the command line, and the ability to use any merge strategy.
- Merge strategies have been overhauled to be more extensible and can be setup to work with any language.
- New PreserveRegions merge strategy has been introduced.
- DbDocumenter templates have been overhauled to be a best-practices sample for 3.0.
- Indented output rendering.
- IPropertySerializer interface can be implemented to allow for serialization of custom property types.
- New PreRender and PostRender methods that can be overridden in your templates.
- Ability to auto-execute SQL scripts after generating them.
- Ability to render to more than one TextWriter at a time.
- SQL 2005 compatibility.
- Tons of other minor improvements and bug fixes.

Installer: http://www.codesmithtools.com/download/codesmith30beta3.exe

Zip: http://www.codesmithtools.com/download/codesmith30beta3.zip

Beta Forum: http://www.ericjsmith.net/codesmith/forum/default.aspx?f=18

Thanks,
Eric J. Smith
CodeSmith Tools

quinta-feira, abril 07, 2005

Working with GUID in vb.net

Dim defaultLang As Guid

strGuid = "CF7EAB76-DC16-46BB-A44D-A301C5BA6319"

defaultLang = New Guid("{" & strGuid & "}")

sexta-feira, março 18, 2005

DataSet - Transformar XML vindo de um WebService em DATASET

Transformar XML vindo do WebService em DATASET:

Dim objmyDS As New DataSet
Dim myXml As New XmlDataDocument
myXml.LoadXml(objTransactionManagerRef.GetClientFavorites(idClient).OuterXml())
objmyDS.ReadXml(New XmlNodeReader(myXml.DocumentElement))

quinta-feira, março 17, 2005

Authentication for web services

"I recently put up a few web services for a client of mine, which returned some sensitive data. I needed to find a simple way to authenticate the users of these web services. This is the approach I took."

Aqui fica o Link para o documento integral:
http://www.codeproject.com/cs/webservices/
authforwebservices.asp


Outra possível solução:

Quando o WSE 2 ainda estava em versao beta eu construiu um esquema para um projecto que tinha em maos na altura. depois o projecto foi cancelado e acabei por nao utilizar a framework na pratica. Da uma olhadela ao codigo. A grande vantagem residia na facilidade configuracao e utilizacao se a comunicacao fosse de .Net para .Net. Pode ser que ajude.

Aqui fica o Link para o documento integral:
http://www.pontonetpt.com/Artigos/209.aspx

Overloading for WebMethods

MessageName
===========
This property useful when we want overloading the WebMethods.

For Example

< WebMethod() > _
Public Function SayHello(ByVal sName As String) As String
Return "Hi" & " " & sName
End Function

< WebMethod(MessageName:="SayHello") > _
Public Function SayHello()As String
Return "Hi Ragavan"
End Function


Restante artigo:
http://www.c-sharpcorner.com/
WebForms/WebServicesP3RSR.asp

quarta-feira, março 16, 2005

Sql Server 2005 - Tech Briefings

Are you planning new database development projects this year? Do you need to increase the scale, performance, security or continuous availability of your existing systems to meet the demands of the business? Microsoft SQL Server 2005 is on its way, bringing significant enhancements in performance, availability, security and the most powerful and flexible set of DBA productivity tools we have ever delivered. Using interactive presentations and live product demos, we will walk you through all the major features and enhancements built into SQL Server 2005 to give you a head start in your plans to bring these benefits to your organization. Topics covered will include SQL Server 2005 management tools, security enhancements, high availability features, replication, and scalability.

We will continue to add deeper and more comprehensive information as the product nears release, so please check back regularly for new and exciting SQL Server 2005 webcasts.


http://www.microsoft.com/events/series/
technetsqlserver2005.mspx

segunda-feira, março 14, 2005

Getting Directory Contents List

Dim strBaseXmlDIR = ConfigurationSettings.AppSettings("BaseXmlDIR")
Dim strXMLFileName As String

Dim objDirectoryInfo As New IO.DirectoryInfo(strBaseXmlDIR)
Dim objFileInfo As IO.FileInfo() = objDirectoryInfo.GetFiles()
Dim objFileInfoElement As IO.FileInfo

For Each objFileInfoElement In objFileInfo
strXMLFileName = strBaseXmlDIR + "\" + objFileInfoElement.ToString()
ListBox1.Items.Add(strXMLFileName)
Next

Best or possible way to return XML from WebServices

Para retornar XML num web service:

< WebMethod(Description:="This method Gets Data") > _
Public Function GetData(ByVal intParameter As Integer) As XmlDataDocument
Dim myXml As New XmlDataDocument
myXml.LoadXml("Data to Return")
return myXml
End Function

Como obter os valores desse XML:
Dim myXml As New XmlDataDocument
myXml.LoadXml(WebService.GetData(intParameter).OuterXml())

Como obter os valores desse XML num só ramo:
Dim myXml As New XmlDataDocument
Dim strRet As String = ""
If (myXml.Item("EquipmentDataList").HasChildNodes()) Then
strRet = myXml.LastChild("Father").Item("Child").InnerText
end if

Para dúvidas peçam ajuda
Paulo A. J. Pires

quarta-feira, março 09, 2005

WebServices: INFO: HTTP GET and HTTP POST Are Disabled by Default

INFO: HTTP GET and HTTP POST Are Disabled by Default

This article discusses changes in the .NET Framework 1.1 that affect the HTTP GET method and the HTTP POST method on a Web server. This article also describes workarounds for this new functionality.

The .NET-connected Web services support HTTP GET, HTTP POST and SOAP protocols. By default, in .NET Framework 1.0, all three protocols are enabled. By default, in .NET Framework 1.1, HTTP GET and HTTP POST are both disabled. This is for security reasons.

http://support.microsoft.com/default.aspx?scid=kb;en-us;819267

segunda-feira, março 07, 2005

How to Enable Remote Debugging on Windows XP Service Pack 2

Windows XP Service Pack 2 introduces a number of security enhancements that increase security in Microsoft Windows. This document outlines the steps that you need to take in order to enable remote debugging on a Windows XP Service Pack 2 machine. (10 printed pages)

http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnwxp/html/xpsp2remotedebug.asp

MSDN Technical Briefing

No último evento MSDN do ano encontramos um conjunto de 4 novas sessões que nos ilustram como estender a plataforma e boas práticas no desenvolvimento de aplicações. A primeira sessão mostra-nos com é possível estender o modelo de processamento de páginas ASP.NET. Saiba como implementar segurança nos serviços Web com WS-Security, que faz parte da implementação de Web Services Enhancements 2.0. Para melhorar o desenvolvimento das soluções veja como tirar partido do debugger do Visual Studio.NET e saiba ainda como fazer deployment das suas aplicações a actualizá-las automaticamente.

http://www.microsoft.com/portugal/msdn/eventos/
TBNovembro/default.aspx

sexta-feira, março 04, 2005

Accessing OLAP using ASP.NET - Creating a .NET Web Application to Access OLAP

This sample web application uses the existing demonstration database named “Foodmart 2000”, which gets automatically installed by SQL Server 2000 Analysis Services (please refer to the previous topic).

http://www.aspfree.com

Accessing Sql Server Datawarehouses Over the Web.

Este documento pode ajudar e muito a fazer o acesso a Olaps via WEB.
Fica aqui o Link: Documento integral em PDF

quarta-feira, março 02, 2005

.NET Framework - TimeSpan

Pessoal, para jogar com datas aqui está uma hipotese

The value of an instance of TimeSpan represents a period of time. That value is the number of ticks contained in the instance and can range from Int64.MinValue to Int64.MaxValue. A tick is the smallest unit of time that can be specified, and is equal to 100 nanoseconds. Both the specification of a number of ticks and the value of a TimeSpan can be positive or negative.
A TimeSpan can be represented as a string in the format "[-]d.hh:mm:ss.ff" where "-" is an optional sign for negative TimeSpan values, the "d" component is days, "hh" is hours, "mm" is minutes, "ss" is seconds, and "ff" is fractions of a second. For example, a TimeSpan initialized to 1.0e+13 ticks represents "11.13:46:40", which is 11 days, 13 hours, 46 minutes, and 40 seconds.
Due to a varying number of days in months and years, the longest unit of time that is used by TimeSpan is the day.
This value type implements the IComparable interface.


http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/cpref/html/frlrfsystemtimespanclasstopic.asp

terça-feira, março 01, 2005

.NET Framework Tools - Installer Tool (Installutil.exe)

.NET Framework Tools - Installer Tool (Installutil.exe)

The Installer tool allows you to install and uninstall server resources by executing the installer components in a specified assembly. This tool works in conjunction with classes in the System.Configuration.Install Namespace.

URL: http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/cptools/html/cpconinstallerutilityinstallutilexe.asp

ASP.NET - PRB: Cannot Upload Large Files When You Use the HtmlInputFile Server Control

Pessoal, encontrei uma dificuldade no upload de ficheiros via .NET, que foi não passar ficheiros superiores a 4 Mb.
“PRB: Cannot Upload Large Files When You Use the HtmlInputFile Server Control”
Ao tentar fazer o upload dava um erro de “The Page Can Not Be Displayed”, ou seja, dava o erro do upload ser enorme e (erro 403), de seguida dava o erro de página não encontrada (404) pois eu não tinha definida a página para o erro 403.

Depois de pesquisar encontrei a solução: http://support.microsoft.com/default.aspx?
scid=kb;en-us;295626


SOLUÇÃO DO ERRO DO UPLOAD
=========================

c:\WINNT\Microsoft.NET\Framework\v1.1.4322\CONFIG
Filename: machine.config
< httpRuntime
executionTimeout="90"
maxRequestLength="819200"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100"
enableVersionHeader="true"
/>

Solução: Alterar o maxRequestLength para o valor necessário ou aceitável no meu caso passei o para 819200 (800 MB) e, testei com um ficheiro de 150 MB e passou, na tentativa de passar um ficheiro de 660 MB não passou, o que pode estar relacionado com a falta de memória no servidor, pois o maxRequestLength está limitado em 2 GB mas só aconselham usar 1 GB e esta memória é partilhada pelos processos de .NET a correr e a monitoria do serviço, por isso em determinados momentos pode ser bastante inferior a 1 GB.
Espero que possa ajudar no futuro a todos os que usem UPLOAD de ficheiros.

Directiva @Page em .NET

Dica sobre ASP.NET.
Como configurar a Directiva @Page. Podem ver por exemplo o AspCompact para aceder a DLLs em VB6 em .NET.

URL: http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/cpgenref/html/cpconPage.asp

ASP.NET - 10 Tips for Writing High-Performance Web Applications

Pessoal da Comunidade de Desenvolvimento para Backoffices,
No e-mail da Microsoft (newsletter) vinha este documento que pode ser interessante.
O URL:http://msdn.microsoft.com/msdnmag/issues/05/01/
ASPNETPerformance/default.aspx

ASP.NET 2.0 - Discovering the New Visual Basic 2005 Language Enhancements

Pessoal da Comunidade de Desenvolvimento para Backoffices,
No e-mail da Microsoft (newsletter) vinha este documento que pode ser interessante.

O URL é : http://msdn.microsoft.com/vstudio/default.aspx?pull=/library/en-us/dnhcvs04/html/vs04k1.asp

Acesso em Server Side a um outro ASPX que retorna valores

A solução para quem precisar no futuro:

Imports System.Net
Dim myRequest As HttpWebRequest
myRequest.Create(URL).GetResponse()

Uso da função RANDOM do SqlServer

Este é um exemplo de Store Procedure para criação de PIN/Password Aleatórios no SQL SERVER.
Experimentem:

- EXEC USP_CreateRandomPWD 0, 4 -> Exemplo para PIN 4 algarismos
- EXEC USP_CreateRandomPWD 1, 20 -> Exemplo para Password de 20 caracteres

A Store Procedure está no 1º Comentário...