Jumat, 25 November 2016

vb.net Codedom

'
'Create Class from String
'

Dim sDom As String = _
            "Public Class tabelturunan" & vbNewLine & _
            "        Inherits this.parentoff" & vbNewLine & _
            "        Sub New()" & vbNewLine & _
            "            MyBase.New()" & vbNewLine & _
            "        End Sub" & vbNewLine & _
            "        Sub New(ByVal s As String)" & vbNewLine & _
            "            MyBase.New(s)" & vbNewLine & _
            "        End Sub" & vbNewLine & _
            "    End Class"
'
' We create object of the compiler 
'
Dim objCodeCompiler As CodeDom.Compiler.CodeDomProvider = CodeDom.Compiler.CodeDomProvider.CreateProvider("VB")
'
' Pass parameters into the compiler.
'
Dim objCompilerParameters As New CodeDom.Compiler.CompilerParameters
objCompilerParameters.ReferencedAssemblies.Add("System.dll")
objCompilerParameters.ReferencedAssemblies.Add("System.Windows.Forms.dll")
objCompilerParameters.ReferencedAssemblies.Add("Microsoft.VisualBasic.dll")

objCompilerParameters.ReferencedAssemblies.Add("System.Data.dll")
objCompilerParameters.ReferencedAssemblies.Add("System.XML.dll")

objCompilerParameters.ReferencedAssemblies.Add("kependudukan.exe")
objCompilerParameters.GenerateInMemory = True
'
' Get te source code and compile it.
'
  Dim objCompileResults As CodeDom.Compiler.CompilerResults = objCodeCompiler.CompileAssemblyFromSource(objCompilerParameters, line)
'
' Check for compiler errors.
'
If objCompileResults.Errors.HasErrors Then
    MsgBox("Error: Line>" & objCompileResults.Errors(0).Line.ToString & ", " & objCompileResults.Errors(0).ErrorText)
    End
End If

Senin, 07 November 2016

mysql_fetch_field

<?php
$conn 
mysql_connect('localhost''mysql_user''mysql_password');
if (!
$conn) {
    die(
'Could not connect: ' mysql_error());
}
mysql_select_db('database');$result mysql_query('select * from table');
if (!
$result) {
    die(
'Query failed: ' mysql_error());
}
/* get column metadata */$i 0;
while (
$i mysql_num_fields($result)) {
    echo 
"Information for column $i:<br />\n";
    
$meta mysql_fetch_field($result$i);
    if (!
$meta) {
        echo 
"No information available<br />\n";
    }
    echo 
"<pre>
blob:         
$meta->blob
max_length:   
$meta->max_length
multiple_key: 
$meta->multiple_key
name:         
$meta->name
not_null:     
$meta->not_null
numeric:      
$meta->numeric
primary_key:  
$meta->primary_key
table:        
$meta->table
type:         
$meta->type
unique_key:   
$meta->unique_key
unsigned:     
$meta->unsigned
zerofill:     
$meta->zerofill
</pre>"
;
    
$i++;
}
mysql_free_result($result);?>

source: http://php.net/manual/en/function.mysql-num-fields.php

Foto Propades