Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 5 - A Wrapper Class for DML Statements Using V...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

A Wrapper Class for DML Statements Using Visual Basic.NET
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 13
    2006-08-16

    Table of Contents:
  • A Wrapper Class for DML Statements Using Visual Basic.NET
  • The beginning of the class
  • Adding a column to the INSERT or UPDATE command
  • Adding code to add binary data for INSERT command
  • Adding code to add binary data for UPDATE command
  • Executing the DML command
  • Completing the class

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    A Wrapper Class for DML Statements Using Visual Basic.NET - Adding code to add binary data for UPDATE command


    (Page 5 of 7 )

    The following is the code necessary for adding a column (of type binary) to the UPDATE command.

    CaseCommandType.Update 'UPDATE command
                    Select Case m_dbObject.ConnectionType
                        Case DBConnType.MSSQL
                            m_SQL &= ColName & "=" & "@" & ColName & ","
                            'the following is same as the above case
                            Dim fileLength As Integer = pFile.ContentLength
                            If (fileLength = 0) Then
                                Throw New Exception("No information is available in selected File..try giving another existing filename")
                            End If
                            Dim FileByteArray(fileLength) As Byte
                            FileStream = UpFile.InputStream
                            FileStream.Read(FileByteArray, 0, fileLength)
                            'append this information to already existing arrays
                            If m_FileColNames Is Nothing Then
                                ReDim m_FileColNames(0)
                                ReDim m_FileByteArrays(0)
                            Else
                                ReDim Preserve m_FileColNames(UBound(m_FileColNames) + 1)
                                ReDim Preserve m_FileByteArrays(UBound(m_FileByteArrays) + 1)
                            End If
                            m_FileColNames(m_FileColNames.Length - 1) = ColName
                            m_FileByteArrays(m_FileByteArrays.Length - 1) = FileByteArray
                        Case Else
                            Throw New Exception("currently this library supports only SQL.NET Provider to upload files")
                    End Select
            End Select

    More Visual Basic.NET Articles
    More By Jagadish Chaterjee


       · Hai guys! enjoy the DML wrapper included in this contribution.
     

    VISUAL BASIC.NET ARTICLES

    - Clocks and Countdowns
    - User-defined Functions using Visual Basic Ap...
    - Understanding Object Binding in VBA
    - Mastering the Message Box
    - Testing a Windows Forms Application
    - Using Visual Basic.NET Features to Code a Wi...
    - Correcting Code in a Windows Forms Applicati...
    - Write Readable Code and Comments for Windows...
    - How to Code and Test a Windows Forms Applica...
    - Adding Features to a Windows Forms Applicati...
    - How to Design a Windows Forms Application
    - LINQ to XML Programming Using Visual Basic.N...
    - Understanding Delegates using Visual Basic.N...
    - Create a Sudoku Puzzle Generator using VB.NET
    - Entity Creation and Messaging in a VB.NET Te...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek