git fetch origin branchName
git checkout branchName
Per fare Merge dal master al branch attuale:
git pull
git merge origin master
git pull
git merge origin master
ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
true
Class CreateTreeViewFromDataTable
' This Dictionary will identify each List<TreeNode>
' And the List<TreeNode> will restore the all TreeNode from a same parentNode
Private Shared dic As Dictionary(Of Integer, List(Of TreeNode))
Public Shared Sub BuildTree(ByVal dt As DataTable, ByVal treeView As TreeView, ByVal expandAll As [Boolean], ByVal displayName As String, ByVal nodeId As String, ByVal parentId As String)
' Clear the TreeView if there are another datas in this TreeView
treeView.Nodes.Clear()
dic = New Dictionary(Of Integer, List(Of TreeNode))()
Dim node As TreeNode = Nothing
For Each row As DataRow In dt.Rows
' Restore each record into a TreeNode
node = New TreeNode(row(displayName).ToString())
node.Tag = row(nodeId)
node.BackColor = Color.FromArgb(row("Colore"))
' The parentId of the TreeView's root is "" in the DataTable
' So if the parentId is a "", then it is the root
' Otherwise it is only a common TreeNode
If row(parentId).ToString() <> "0" Then
Dim _parentId As Integer = Convert.ToInt32(row(parentId))
' If there's exists a List<TreeNode> was identified by this _parentId
' Then we need put this node into this identified List<TreeNode>
If dic.ContainsKey(_parentId) Then
dic(_parentId).Add(node)
Else
' Otherwise
' We will Add a new record into the Dictionary<int, List<TreeNode>>
dic.Add(_parentId, New List(Of TreeNode)())
' Then put this node into the new List<TreeNode>
dic(_parentId).Add(node)
End If
Else
' Take this node into the place of the TreeView's root
node.NodeFont = New Font(treeView.Font, FontStyle.Bold)
node.BackColor = Color.FromArgb(row("Colore"))
node.Text = "[" & row("DesSpeciale") & "]" & vbTab & vbTab & node.Text
treeView.Nodes.Add(node)
End If
Next
' After collect and identify each collection with their parentId
' We will go on building this tree with the founded root node
SearchChildNodes(treeView.Nodes(0))
If expandAll Then
' Expand the TreeView
treeView.ExpandAll()
End If
End Sub
Private Shared Sub SearchChildNodes(ByVal parentNode As TreeNode)
If Not dic.ContainsKey(Convert.ToInt32(parentNode.Tag)) Then
' If there's no a identified collection by this parentId
' We will do nothing and return directly
Return
End If
' Put the identified collection by this parentId into the tree as this node's children
parentNode.Nodes.AddRange(dic(Convert.ToInt32(parentNode.Tag)).ToArray())
' See these children nodes as parent nodes
For Each _parentNode As TreeNode In dic(Convert.ToInt32(parentNode.Tag)).ToArray()
' Then go to find the identified collection by these id
SearchChildNodes(_parentNode)
Next
End Sub
End Class
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
%windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe -i
Con questa procedura è possibile intercettare un particolare errore (in questo caso un Deadlock), e rieseguire la procedura richiesta, per un determinato numero di volte (per evitare un loop)
DECLARE @RetryCounter INT
SET @RetryCounter = 1
RETRY: -- Label RETRY
BEGIN TRANSACTION
BEGIN TRY
UPDATE Customer SET LastName = 'John' WHERE CustomerId=111
COMMIT TRANSACTION
END TRY
BEGIN CATCH
PRINT 'Rollback Transaction'
ROLLBACK TRANSACTION
DECLARE @DoRetry bit; -- Whether to Retry transaction or not
DECLARE @ErrorMessage varchar(500)
SET @doRetry = 0;
SET @ErrorMessage = ERROR_MESSAGE()
IF ERROR_NUMBER() = 1205 -- Deadlock Error Number
BEGIN
SET @doRetry = 1; -- Set @doRetry to 1 only for Deadlock
END
IF @DoRetry = 1
BEGIN
SET @RetryCounter = @RetryCounter + 1 -- Increment Retry Counter By one
IF (@RetryCounter > 3) -- Check whether Retry Counter reached to 3
BEGIN
RAISERROR(@ErrorMessage, 18, 1) -- Raise Error Message if
-- still deadlock occurred after three retries
END
ELSE
BEGIN
WAITFOR DELAY '00:00:00.05' -- Wait for 5 ms
GOTO RETRY -- Go to Label RETRY
END
END
ELSE
BEGIN
RAISERROR(@ErrorMessage, 18, 1)
END
END CATCH
SELECT SYS_OBJ.NAME AS "TABLE NAME"
, SYS_INDX.ROWCNT AS "ROW COUNT"
FROM SYSOBJECTS SYS_OBJ, SYSINDEXES SYS_INDX
WHERE SYS_INDX.ID = SYS_OBJ.ID
AND INDID IN(0,1)
AND XTYPE = 'U'
AND SYS_OBJ.NAME <> 'SYSDIAGRAMS'
ORDER BY SYS_INDX.rowcnt DESC
COMPUTE SUM(SYS_INDX.ROWCNT)
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />
<meta http-equiv="EXPIRES" content="0" />
<meta http-equiv="PRAGMA" content="NO-CACHE" />
Response.Write("")
<center>
<FORM method=GET action="http://www.google.com/search">
<TABLE bgcolor="#FFFFFF"><tr><td>
<A HREF="http://www.google.com" target="_blank">
<IMG SRC="http://www.google.com/logos/Logo_40wht.gif" border="0"
ALT="Google" align="absmiddle"></A>
<INPUT TYPE=text name=q size=31 maxlength=255 value="">
<INPUT TYPE=hidden name=hl value=it>
<INPUT type=submit name=btnG VALUE="Cerca con Google">
</td></tr></TABLE>
</FORM>
</center>
Per ottenere il numero di versione per le applicazioni distribuite tramite il clickonce è sufficiente importare la referenza al progetto all'oggetto
System.Deployment
if
(System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
this .Text = String.Format( "MRS Map Printing Manager {0}" , |
Application.ApplicationDeployment.CurrentDeployment.CurrentVersion); |
} |
Function UltimoGiorno(Data_Gio as Date) as Date
if Date_Gio = "" then
Data_Gio = Date
end if
UltimoGiorno = DateSerial( Year(Data_Gio), Month(Data_Gio)+1, 0 )
End Function
Se state sviluppando un’applicazione che utilizza SQL Server Compact Edition su una macchina x64, impostare nelle opzioni avanzate di compilazione la CPU di destinazione come “x86” e non “AnyCPU” per non incorrere nell’errore sopracitato (un P/Invoke non riuscito da parte di System.Data.SqlServerCe verso sqlceme35.dll). E’ da tenere conto che si applica sia alla versione 3.0, alla 3.5 ed alla 4. Questo perchè SQL Server Compact Edition su macchina x64 gira in WoW (Windows on Windows, emulazione x86 su x64).
Aprire VS2008, click su Tools/Options
Check "Show all settings" option
Selezionare Environment/International Settings
Cambiare la lingua del combo box
Chiudere VS2008.
Lanciare da riga di comando devenv /resetskippkgs