Link para descargar - CSS friendly adapters
http://download.microsoft.com/download/b/a/3/ba3aee5e-2e28-4056-9e71-036b2e7f58af/ASPNETCssFriendlyAdapters.vsi
Walkthrough:
http://www.asp.net/CSSAdapters/WalkThru/WalkThrough.aspx#DownloadAndInstall
Como usarlos en SHAREPOINT
http://vspug.com/mossman/2007/03/08/css-friendly-control-adapters-in-sharepoint-2007-a-walk-through/
http://blogs.tamtam.nl/frank/PermaLink,guid,aad39854-4f7d-4666-8a0a-0fc02f3cd01b.aspx
Consulta con conexión DSNLess a MySql desde C#
using System.Data.Odbc;
string odbcconnstr = "Driver={MySQL ODBC 3.51 Driver};Server=servidor;Database=base;User=usuario;Password=password;Port=puerto;Option=4";
OdbcConnection conn;
conn = new OdbcConnection(odbcconnstr);
conn.Open();
OdbcCommand cmd = new OdbcCommand();
cmd.Connection = conn;
cmd.CommandText = "select * from tabla";
OdbcDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
// codigo
}
conn.Close();
Agregar texto a una celda
using Microsoft.Office.Interop.Excel;Range rango = Globals.ThisAddIn.Application.Cells;rango[1, 1] = "Datos en celda!!";
Conexión DSNLess a MySql utilizando MySql ODBC 3.51
Dim conn
Set conn = CreateObject("ADODB.Connection")
conn.Open "Driver={MySQL ODBC 3.51 Driver};Server=servidor;Database=base;User=usuario;Password=password;Port=puerto;Option=4;"
msgbox "ok!"
Consultas recursivas con CAML
<Query>
<Where>
<Eq>
<FieldRef Name='nombre_campo' />
<Value Type='Number'>1234</Value>
</Eq>
</Where>
<QueryOptions>
<ViewAttributes Scope = 'Recursive'/>
</QueryOptions>
</Query>
Crear un asp menu por código
Menu m = new Menu(); XmlDataSource x = new XmlDataSource(); x.DataBind(); x.EnableCaching = false; m.MaximumDynamicDisplayLevels = 4; m.StaticDisplayLevels = 10; m.DynamicHorizontalOffset = 1; m.DynamicVerticalOffset=1; string s = "" + ""; x.Data = s; m.DataSource = x; m.DataBind(); // Controls.Add(m); // m.DataBind(); form1.Controls.Add(m); //Panel1.DataBind();
Ampliar el tamaño del disco duro en VirtualBox
1. Crear un segundo disco para la máquina que se desee ampliar, con la capacidad que se quiera (ej, si tengo un disco de 10gb, agrego otro de 30gb y lo establezco como primary slave) 2. Mapear el CD-ROM de la máquina, con el ISO de clonezilla (se puede bajar el iso desde: www.clonezilla.org) 3. Reiniciar la máquina, seguir las instrucciones de clonezilla (clonar disco a disco) 4. Cuando finalice la operación de clonezilla, cambiar el disco primary slave para que quede como primary master, y el otro dejarlo como primary slave (este último se puede borrar luego de verificar que todo quedó ok) 5. Iniciar la máquina. Ir al administrador de discos y extender la partición del c: para que ocupe todo el espacio disponible. 6. Listo, se puede borrar el disco primary slave.
Hay una guía mas extensa en http://www.my-guides.net/en/content/view/122/26/
pero el método anterior funciona OK.
Espacio ocupado por las tablas de una base SQL Server
if exists (select * from sysobjects where id = object_id('dbo.p_sizetables') and sysstat & 0xf = 4)
drop procedure dbo.p_sizetables
GO
create procedure dbo.p_sizetables
as
Begin transaction
SET NOCOUNT ON
declare @nombre_tabla varchar(100)
declare @propietario varchar(40)
declare @uid int
declare @nombre_completo varchar(150)
declare @nombre_db varchar(256)
create table #resultados
(nombre varchar(50),
filas decimal(12,0),
reservado varchar(40),
data varchar(40),
tamaño_indice varchar(20),
no_usado varchar(20))
declare tablas cursor
for select a.uid , propietario = left( b.name,40), tabla = a.name from sysobjects a, sysusers b
where type = 'U' and a.uid = b.uid and order by tabla
select @nombre_db = db_name()
OPEN tablas
FETCH NEXT FROM tablas into @uid, @propietario, @nombre_tabla
WHILE @@FETCH_STATUS = 0
BEGIN
if @uid = 1
begin
insert #resultados
exec sp_spaceused @nombre_tabla
end
else
begin
SET @nombre_completo = rtrim(ltrim(@nombre_db))+'.' + ltrim(rtrim(@propietario)) +'.'+ @nombre_tabla
insert #resultados
exec sp_spaceused @nombre_completo
end
FETCH NEXT FROM tablas INTO @uid, @propietario, @nombre_tabla
END
CLOSE tablas
DEALLOCATE tablas
select * from #resultados
order by data desc
Commit Transaction
Luego ejecutarlo así:
use [base] exec p_sizetables
Si muestra un error por algún problema de acceso, filtrar los usuarios de esta forma:
declare tablas cursorfor select a.uid , propietario = left( b.name,40), tabla = a.name from sysobjects a, sysusers bwhere type = 'U' and a.uid = b.uid and b.name <> 'usuario' order by tabla
Crear un aspmenu por código
Menu m = new Menu(); XmlDataSource x = new XmlDataSource(); x.DataBind(); x.EnableCaching = false; m.MaximumDynamicDisplayLevels = 4; m.StaticDisplayLevels = 10; m.DynamicHorizontalOffset = 1; m.DynamicVerticalOffset=1; string s = "" + ""; x.Data = s; m.DataSource = x; m.DataBind(); form1.Controls.Add(m);
Zip y Unzip desde Excel VBA
Fuente: http://www.rondebruin.nl/windowsxpzip.htm
Sub Unzip1()
Dim FSO As Object
Dim oApp As Object
Dim FName As Variant
Dim FileNameFolder As Variant
Dim DefPath As String
Dim strDate As String
FName = Application.GetOpenFilename(filefilter:="Zip Files (*.zip), *.zip", _
MultiSelect:=False)
If FName = False Then
'Do nothing
Else
'Root folder for the new folder.
'You can also use DefPath = "C:\Users\Ron\test\"
DefPath = Application.DefaultFilePath
If Right(DefPath, 1) <> "\" Then
DefPath = DefPath & "\"
End If
'Create the folder name
strDate = Format(Now, " dd-mm-yy h-mm-ss")
FileNameFolder = DefPath & "MyUnzipFolder " & strDate & "\"
'Make the normal folder in DefPath
MkDir FileNameFolder
'Extract the files into the newly created folder
Set oApp = CreateObject("Shell.Application")
oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(FName).items
'If you want to extract only one file you can use this:
'oApp.Namespace(FileNameFolder).CopyHere _
'oApp.Namespace(Fname).items.Item("test.txt")
MsgBox "You find the files here: " & FileNameFolder
On Error Resume Next
Set FSO = CreateObject("scripting.filesystemobject")
FSO.deletefolder Environ("Temp") & "\Temporary Directory*", True
End If
End Sub
Sub Zip_File_Or_Files()
Dim strDate As String, DefPath As String, sFName As String
Dim oApp As Object, iCtr As Long, I As Integer
Dim FName, vArr, FileNameZip
DefPath = Application.DefaultFilePath
If Right(DefPath, 1) <> "\" Then
DefPath = DefPath & "\"
End If
strDate = Format(Now, " dd-mmm-yy h-mm-ss")
FileNameZip = DefPath & "MyFilesZip " & strDate & ".zip"
'Browse to the file(s), use the Ctrl key to select more files
FName = Application.GetOpenFilename(filefilter:="Excel Files (*.xl*), *.xl*", _
MultiSelect:=True, Title:="Select the files you want to zip")
If IsArray(FName) = False Then
'do nothing
Else
'Create empty Zip File
NewZip (FileNameZip)
Set oApp = CreateObject("Shell.Application")
I = 0
For iCtr = LBound(FName) To UBound(FName)
vArr = Split97(FName(iCtr), "\")
sFName = vArr(UBound(vArr))
If bIsBookOpen(sFName) Then
MsgBox "You can't zip a file that is open!" & vbLf & _
"Please close it and try again: " & FName(iCtr)
Else
'Copy the file to the compressed folder
I = I + 1
oApp.Namespace(FileNameZip).CopyHere FName(iCtr)
'Keep script waiting until Compressing is done
On Error Resume Next
Do Until oApp.Namespace(FileNameZip).items.Count = I
Application.Wait (Now + TimeValue("0:00:01"))
Loop
On Error GoTo 0
End If
Next iCtr
MsgBox "You find the zipfile here: " & FileNameZip
End If
End Sub
Sub NewZip(sPath)
'Create empty Zip File
'Changed by keepITcool Dec-12-2005
If Len(Dir(sPath)) > 0 Then Kill sPath
Open sPath For Output As #1
Print #1, Chr$(80) & Chr$(75) & Chr$(5) & Chr$(6) & String(18, 0)
Close #1
End Sub
Function bIsBookOpen(ByRef szBookName As String) As Boolean
' Rob Bovey
On Error Resume Next
bIsBookOpen = Not (Application.Workbooks(szBookName) Is Nothing)
End Function
Function Split97(sStr As Variant, sdelim As String) As Variant
'Tom Ogilvy
Split97 = Evaluate("{""" & _
Application.Substitute(sStr, sdelim, """,""") & """}")
End Function
Agregar fichas y botones personalizados a Office 2007
Mediante Microsoft Office 2007 Custom UI Editor es posible agregar elementos al "ribbon" de Office y vincularlos con métodos escritos en VBA. Estos son los pasos:
Se puede descargar el Custom UI Editor desde el sitio OpenXML Developer
Cargar en el Custom UI Editor el archivo de Office al que se le quiere agregar una custom ribbon
Editando el xml se pueden agregar elementos.
En este ejemplo, se agrega una ficha llamada "Procesos Especiales" y dos botones "Cargar" y "Grabar"
En el campo onAction se debe especificar un nombre de método, que será creado luego en VBA de esta forma:
Este método debe ir en un módulo global (no en una hoja)
Bajar la galería de íconos para Office desde esta ubicación
Abrir el excel de la galería.
Habilitar la ficha "programador" (botón de Office/opciones de excel/Mostrar ficha programador en la cinta de opciones)
Elegir una galería y hacer click en el ícono que se desee utilizar.
Al hacer click sobre el ícono aparece el nombre: imageMSO: DatabasePermissionsMenu
Este es el nombre que debe utilizarse en el xml (ver imágen de arriba), de esta forma:
imageMso=DatabasePermissionsMenu
Otro link interesante: Visual Ribbon Editor
Lista de IDs de elementos de Office: Office Control IDs Excel2007
Se puede descargar el Custom UI Editor desde el sitio OpenXML Developer
Cargar en el Custom UI Editor el archivo de Office al que se le quiere agregar una custom ribbon
Editando el xml se pueden agregar elementos.
En este ejemplo, se agrega una ficha llamada "Procesos Especiales" y dos botones "Cargar" y "Grabar"
En el campo onAction se debe especificar un nombre de método, que será creado luego en VBA de esta forma:
Sub rxbtn_Click(control As IRibbonControl)
If control.ID = "btn_Cargar" Then
Cargar
Else
If control.ID = "btn_Grabar" Then
Grabar
End If
End If
End Sub
Este método debe ir en un módulo global (no en una hoja)
Bajar la galería de íconos para Office desde esta ubicación
Abrir el excel de la galería.
Habilitar la ficha "programador" (botón de Office/opciones de excel/Mostrar ficha programador en la cinta de opciones)
Elegir una galería y hacer click en el ícono que se desee utilizar.
Al hacer click sobre el ícono aparece el nombre: imageMSO: DatabasePermissionsMenu
Este es el nombre que debe utilizarse en el xml (ver imágen de arriba), de esta forma:
imageMso=DatabasePermissionsMenu
Otro link interesante: Visual Ribbon Editor
Lista de IDs de elementos de Office: Office Control IDs Excel2007
Como formatear los tags pre para que queden como en este blog
pre {
overflow: auto;
padding-left: 15px;
padding-right: 15px;
font-size: 11px;
line-height: 15px;
margin-top: 10px;
width: 93%;
display: block;
background-color: #eeeeee;
color: #000000;
max-height: 300px;
}
Suscribirse a:
Entradas (Atom)