Assembly: EDKB12WS (in EDKB12WS.exe)

Syntax

Visual Basic

Public Shared Function Office_Vorlage_Get_From_DB( _
   ByVal office_vorlagenr As Integer, _
   ByVal Filename As String _
) As String

C#

public static string Office_Vorlage_Get_From_DB(
   intoffice_vorlagenr,
   stringFilename
)

C++

public: 
static String^ Office_Vorlage_Get_From_DB(
   intoffice_vorlagenr,
   StringFilename

JScript

public static function Office_Vorlage_Get_From_DB(
    office_vorlagenr : int,
    Filename : String
) : String;

Parameters

office_vorlagenr

 

Filename

 

 

 

 

Source code

Visual Basic

 Public Function Office_Vorlage_Get_From_DB(ByVal office_vorlagenr As Integer, ByVal Filename As String) As String
    If Param.DebugMode Then
        DivFnkt.InsertJournale("EDKB12: Start Office_Vorlage_Get_From_DB", clsDivFnkt.Enum_InfoTyp.Information)
    End If
    Dim s As String = "Select * From office_vorlage_datei where office_vorlage_Dateinr=" + Trim(Str(office_vorlagenr))
    If Param.CheckOffice2010_Vorlage = True Then
        s = "Select * from Office2010_Vorlage_datei where office_vorlage_dateinr=" + Trim(Str(office_vorlagenr))
    End If
    Dim connection As New SqlConnection()
    Dim da As New SqlDataAdapter(s, connection)
    Dim CB As SqlCommandBuilder = New SqlCommandBuilder(da)
    Dim ds As New DataSet()
    Try
        connection.ConnectionString = Param.connectionstring
        connection.Open()
        da.Fill(ds, "docs")
        Dim myRow As DataRow
        myRow = ds.Tables(0).Rows(0)
        Dim MyData() As Byte
        MyData = myRow.Item(2)
        Dim K As Long
        K = UBound(MyData)
        Dim fs As New FileStream(Filename, FileMode.OpenOrCreate, FileAccess.Write)
        fs.Write(MyData, 0, K)
        fs.Close()
        fs = Nothing
        If Param.DebugMode Then
            DivFnkt.InsertJournale("EDKB12: Ende GOffice_Vorlage_Get_From_DB (True)", clsDivFnkt.Enum_InfoTyp.Information)
        End If
        Return Filename
    Catch ex As Exception
        DivFnkt.InsertJournale("EDKB12::Fehler:: Office_Vorlage_Get_From_DB::" & ex.Message, clsDivFnkt.Enum_InfoTyp.Fehler)
        If Param.DebugMode Then
            DivFnkt.InsertJournale("EDKB12: Ende GOffice_Vorlage_Get_From_DB (False)::" & ex.Message, clsDivFnkt.Enum_InfoTyp.Information)
        End If
        Return ""
    End Try
    CB = Nothing
    ds = Nothing
    da = Nothing
    connection.Close()
    connection = Nothing
 End Function 

Platforms

Windows 8, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

 

Version Information

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0
 

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0
 

XNA Framework

Supported in: 3.0, 2.0, 1.0
 

 

See Also