miércoles, 31 de diciembre de 2008

Obtener el dirctorio actual de la aplicacion

string dir = System.IO.Directory.GetCurrentDirectory();

Soluciones CRM Argentina

martes, 30 de diciembre de 2008

atributo propiedad por defecto vb.net

imports System.ComponentModel


_
Class Prueba
Inherits Control
Public Property Item() As Control
Get
Return newPropertyValue
End Get
Set(ByVal value As Control)
newPropertyValue = value
End Set
End Property
End Class

viernes, 19 de diciembre de 2008

agregar evento en vb.net

Este es la linea a agregar para que "ate" el evento del control al sub

AddHandler boton.Command, AddressOf BotonNoContestadas_OnCommand

Funcion donde se pone que hacer cuando se ejecuta el evento:
Private Sub BotonNoContestadas_OnCommand(ByVal sender As Object, ByVal e As CommandEventArgs)

End Sub


Desarrollo de Soluciones Informaticas

miércoles, 10 de diciembre de 2008

Numeros verdaderamente random en vb.net

poner este namespace:

Imports System.Security.Cryptography


codigo:

Dim ByteArray As Byte() = New Byte(3) {}
Dim rnd As New RNGCryptoServiceProvider()
rnd.GetBytes(ByteArray)
Return BitConverter.ToInt32(ByteArray, 0)


Diseño de sistemas a medida

viernes, 5 de diciembre de 2008

deshabilitar boton de imagen y "grisarlo" en asp.net

Private Sub deshabilitarBoton(ByVal img As ImageButton, ByVal habilitado As Boolean)
img.Enabled = habilitado
img.Style.Clear()
If Not habilitado Then
img.Style.Add("filter", "alpha(opacity=30)")
End If
End Sub

Obtener datatable de un sqlDtasource

Se obtiene de un metodo del SqldataSource

datasourceControl es del tipo SqldataSource

dim view as DataView = datasourceControl.Select(New DataSourceSelectArguments)
dim table as DataTable = view.ToTable()

lunes, 1 de diciembre de 2008

Hacer que una propiedad sea obligatoria

RequiredProperty()> _
Public Property Nombre_Propiedad() As String