You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.
Dim oForm As Form
For Each oForm In Me.MdiChildren
If Not TypeName(oForm) = "MDIForm" Then
If oForm.Name = "frmHotel" Then
MessageBox.Show(oForm.GetType.ToString + "|" + CType(oForm, frmHotel).hotelid.ToString)
End If
End If
Next
4
VB.NET
GUI, MDI-Fenster
Alle MDIChilds durchlaufen
Dim oForm As Form
For Each oForm In Me.MdiChildren
If Not TypeName(oForm) = "MDIForm" Then
If oForm.Name = "frmHotel" Then
' Es gibt mind. 1 geöffnetes Browser-Fenster
' ...
End If
End If
Next
66
T-SQL
Datenbank
Ausführen von SQL-Code per Aufruf
http://www.databasejournal.com/features/mssql/article.php/3286501/T-SQL-Programming-Part-4---Setting-Variables-in-Calling-T-SQL-Code-While-Using-spexecutesql.htm
use Northwind
go
declare @RECCNT int
declare @ORDID varchar(10)
declare @CMD Nvarchar(100)
set @ORDID = 10436
SET @CMD = 'SELECT @RECORDCNT=count(*) from [Orders]' +
' where OrderId < @ORDERID'
print @CMD
exec sp_executesql @CMD,
N'@RECORDCNT int out, @ORDERID int',
@RECCNT out,
@ORDID
print 'The number of records that have an OrderId' +
' greater than ' + @ORDID + ' is ' +
cast(@RECCNT as char(5))
114
Android
GUI, ComboBox
ComboBox füllen
public void fillSpn()
{
String dummyarr[];
Spinner spn1 = (Spinner) findViewById(R.id.spn1);
// Dummy Data
dummyarr = new String[5];
int i;
for (i=0;i<5;i++)
{
dummyarr[i]=String.valueOf(i);
}
ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, dummyarr);
spn1.setAdapter(adapter);
}
68
VB.NET
GUI, Komponenten allgemein
Dezimal/Währungseingabe in zwei Textboxen
Sub TextBox1KeyUp(sender As Object, e As KeyEventArgs)
If ((e.KeyCode = Keys.Oemcomma) OR (e.KeyCode = Keys.Decimal)) Then
CType(Sender,TextBox).Text = CType(Sender,TextBox).Text.Trim(",")
CType(Sender,TextBox).SelectionStart = CType(Sender,TextBox).Text.Length
For i As Integer = 0 To Me.Controls.Count-1
If Me.Controls.Item(i).TabIndex = CType(Sender,TextBox).TabIndex+1 Then
CType(Me.Controls.Item(i),TextBox).Focus
End If
Next
End If
End Sub
234
PowerShell
Datum, Zeit
Aktuelles Datum/Uhrzeit
$myDate=Get-Date -format "yyyy-MM-dd hh:mm";
write-host $myDate -Foregroundcolor Cyan;
# 2014-01-14 10:15 # Maybe AM or PM
# For 24h Version
$myDate=Get-Date -format "yyyy-MM-dd HH:mm";
write-host $myDate -Foregroundcolor Cyan;
# 2014-01-14 22:15
112
Android
GUI, Dialoge
Hinweis-Dialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Hinweis")
.setTitle("Hinweis-Meldung")
.setNeutralButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
69
C#
GUI, .NET-WPF
Ressource aus separater Style-Ressource
var tbo = new TextBlock
{
Style = (Style)Application.Current.FindResource("MyTextBlockStyle")
};
52
Java
Datum, Zeit
Aktuelles Datum/Uhrzeit
SimpleDateFormat formatter = new SimpleDateFormat ("yyyy.MM.dd 'at' HH:mm:ss ");
Date currentTime = new Date();
System.out.println("Zeit und Datum : " + formatter.format(currentTime));