Valida TextBox si es Entero o Decimal
->
Bueno estas funciones ayudan a validar si el texto ingresado en un textbox es un valor numérico ó es un valor decimal, estas son de las validaciones más usadas para desarrollar así que acá se los dejo.
-
Public Shared Function EsInteger(ByVal theValue As String) As Boolean
-
'funcion para enteros
-
Try
-
Convert.ToInt32(theValue)
-
Return True
-
Catch
-
Return False
-
End Try
-
End Function
-
-
Public Shared Function EsDecimal(ByVal theValue As String) As Boolean
-
'funcion para enteros
-
Try
-
Convert.ToDecimal(theValue)
-
Return True
-
Catch
-
Return False
-
End Try
-
End Function
-
public static bool EsInteger(string theValue)//funcion para enteros
-
{
-
try
-
{
-
Convert.ToInt32(theValue);
-
return true;
-
}
-
catch
-
{
-
return false;
-
}
-
}
-
-
public static bool EsDecimal(string theValue)//funcion para enteros
-
{
-
try
-
{
-
Convert.ToDecimal(theValue);
-
return true;
-
}
-
catch
-
{
-
return false;
-
}
-
}
otra manera de validar de parte de @cmsalvado gracias por el dato:
-
Public Shared Function EsInteger(ByVal theValue As String) As Boolean
-
Dim value As Integer
-
Return Integer.TryParse(theValue, value)
-
End Function
-
public static bool EsInteger(string theValue)
-
{
-
int value;
-
return int.TryParse(theValue, out value);
-
}
bueno espero les sea de gran ayuda.
nos vemos
Saber cuanta memoria consume SQL Server MSSQL
->
para saber el consumo real SQL Server se debe de usar dbcc memorystatus como comando SQL, y nos dará el siguiente resultado de datos, en la primera sección Memory Manager valores expresados en Kb:
Buffer Distribution Buffers ------------------------------ ----------- Stolen 241 Free 95 Procedures 89 Inram 0 Dirty 16 Kept 0 I/O 0 Latched 18 Other 880 (9 row(s) affected)
para más info revisar esto http://support.microsoft.com/kb/271624.
El revisar el administrador de tareas no te dará el valor correcto del uso de la memoria del SQL server.
nos vemos.

validar si hay texto en un textbox vb.net c#
->
Esta código ayuda a revisar si existe un texto ingresado en un textbox en VB.net y C#.
-
If TextBox.Text.Length <1 Then
-
MessageBox.Show(Me, "Debe colocar un cliente válido", "error", MessageBoxButtons.OK, MessageBoxIcon.[Error])
-
Return
-
End If
-
if (TextBox.Text.Length <1)
-
{
-
MessageBox.Show(this, "Debe colocar un cliente válido", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
-
return;
-
}
nos vemos espero les sirva algo sencillo pero muy útil.



























