Category Archives: Microsoft

ASP.Net

DataAdapter

Para os programaddores que utilizam DataSets e DataAdapter, aqui vai uma dica:

Quando utilizamos o DataAdapter, não há a necessidade de abrirmos a conexão com a Base de Dados manualmente, pois ele se encarrega de fazer isso implicitamente. Basta informar a ConnectionString:

Imports System.Data.SqlClient

Dim ds As New DataSet()
Dim da As New SqlDataAdapter(“SELECT * FROM authors”, “ConnectionString”)
da.Fill(ds)
Me.DataGrid1.DataSource = ds

 Link

ASP.Net

Explore o DataReader

por Israel Aéce
Há aplicações as quais necessitam dos dados sempre em tempo real, apresentando o conteúdo mais atualizado possível ao usuário. Muitos clientes necessitam ainda de uma forma rápida para diminuir o tempo de espera de uma determinada solicitação.

Tendo este cenário, temos a meta de desenvolvermos um software que seja bastante eficiente na busca e exibição de dados ao cliente. Este artigo explicará como e quais as melhores práticas, tanto para resgatar dados da base de dados quanto para manipular e exibí-los.

A Plataforma .NET fornece um objeto chamado DataReader, o qual está contido dentro do Namespace System.Data e que por sua vez tem como finalidade resgatar os dados da base de dados de forma extremamente rápida. Como o DataReader é uma espécie de cursor e “caminha” somente para frente, seus dados são somente para leitura, não sendo possível fazermos nada mais com estes dados a não ser exibi-los ao usuário final. Em uma linguagem mais técnica dizemos que o DataReader é foward-only (somente avança) e read-only (somente leitura).

Artigo completo

Code Snippets ASP.Net

access to datalist value

You can access the Datalist values of a row like this :

In the ItemDataBound event of the DataList,
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem){
object row_items=e.Item.DataItem;
// If you have a column called customerId,
object items = e.Item.DataItem;
string str1=Convert.ToString(DataBinder.Eval(row_items,”c ustomerId”));
}

Additional info:
You can find the controls in thge ItemTemplate of your datalist :
In ItemDataBound event :
eg :

((LinkButton)e.Item.FindControl(“LinkB”)).CommandA rgument=e.Item.ItemIndex.T
oString();

This will set the commandargument for the Linkbutton, LinkB.
The above code is in C#.
You can easily convert it into VB.NET.Let me know if you have any
problems.

Marshal Antony

ASP.Net 2.0

ASP.NET 2.0

asp net

ASP.NET 2.0 improves on 1.0 by adding master pages and themes (for maintaining a consistent appearance on all pages) and more.

Microsoft News

Windows Media Encoder

Windows Media Encoder

Windows Media Encoder is a powerful tool for content producers who want to capture audio and video content using the many innovations in Windows Media, including high-quality multichannel sound, high-definition video quality, and support for mixed-mode voice and music content.

Windows Media Encoder is currently available as Windows Media Encoder 9 Series (32 and 64 bit versions) and Windows Media Encoder Studio Edition Beta 1 version.

http://www.microsoft.com/windows/windowsmedia/forpros/encoder/default.mspx

IIS

Configurar o SSL em um servidor Web

O SSL (Secure Sockets Layer) é um conjunto de tecnologias criptográficas que fornece autenticação, confidencialidade e integridade de dados. O SSL é mais comumente usado entre navegadores da Web e servidores Web para criar um canal de comunicação seguro. Ele também pode ser usado para fornecer segurança às comunicações entre aplicativos cliente e serviços da Web.

Para dar suporte a comunicações SSL, um servidor Web deve ser configurado com um certificado SSL. Este módulo descreve como obter um certificado SSL e como configurar o Microsoft® Internet Information Services (IIS) para dar suporte a comunicações seguras com navegadores da Web e outros tipos de aplicativos cliente usando o SSL.

fonte

read more »

IIS

Hosting Multiple Web Sites (IIS 6.0)

IIS 01o create and host multiple Web sites, you must first ensure that each site has a unique identification. To accomplish this, you will need to either obtain multiple IP addresses or assign multiple host header names to a single IP address. Host header names are the friendly names for Web sites, such as IIS 02www.microsoft.com.Obtaining and maintaining multiple IP addresses is usually a task reserved for large corporations and Internet service providers (ISPs), while assigning multiple host header names is a fairly simple procedure accomplished through IIS Manager.
Your computer or network must be using a name resolution system (typically DNS) in order to use multiple host header names.
IIS

Administering Servers Remotely in IIS 6.0 (IIS 6.0)

You can administer your server remotely by running IIS on an intranet or the Internet. You can use the following tools for this purpose:

  • IIS Manager: You can use IIS Manager on your server to remotely connect to and administer an intranet server running IIS 5.0, IIS 5.1, or IIS 6.0 (IIS 3.0 and IIS 4.0 are not supported).
  • Terminal Services: Terminal Services does not require you to install IIS Manager on the remote client computer because, once connected to the server running IIS, you use IIS Manager on the Web server as if you are logged on to the server locally.
  • Remote Administration (HTML) Tool: You can use the Remote Administration (HTML) tool to administer your IIS Web server from any Web browser on your intranet. This version of the Remote Administration (HTML) tool is supported only on servers running Windows Server 2003 with IIS 6.0.

main info em:
www.microsoft.com/technet/
http://support.microsoft.com/kb/324282

Code Snippets ASP.Net

Adding Client-Side Message Boxes in your ASP.NET Web Pages

One of the useful features in a Windows desktop application that many programmers and end-users take for granted is message boxes. Two of the most common types of message boxes are alerts and confirms. A confirm message box prompts the user if they want to continue, and provides two choices: “OK” and “Cancel”. Clicking “OK” confirms the action, while “Cancel” cancels it.

Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If (Not Page.IsPostBack) Then
Me.BtnDelete.Attributes.Add("onclick", _
"return confirm('Are you sure you want to delete?');")
End If
End Sub

http://aspnet.4guysfromrolla.com/articles/021104-1.aspx

http://www.dotnetjunkies.com

ASP.Net

Método Command.ExecuteScalar

Use the ExecuteScalar method to retrieve a single value (for example, an aggregate value) from a database. This requires less code than using the ExecuteReader method, and then performing the operations necessary to generate the single value from the data returned by a DataReader.

A typical ExecuteScalar query can be formatted as in the following VB example:

conn = New Data.SqlClient.SqlConnection(strConn)
cmd = New Data.SqlClient.SqlCommand(sSQL, conn)
Dim ValorDB as Integer = cmd.ExecuteScalar()