Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to convert the code into C#, windows application

How to convert the code into C#, windows application

Scheduled Pinned Locked Moved C#
csharpdatabasetutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Syed Naushad S
    wrote on last edited by
    #1

    If InStr(sTotalRows, "TOP 100 PERCENT *", CompareMethod.Text) > 0 And Trim(sCondition = "") Then 'If db.Tables.Item(sTableName).Rows > 0 Then db.Tables.Item(sTableName).ExportData(objBCPExport) 'End If Else Dim sSelectCommand As String = "select " + sTotalRows + " from " + sDatabaseName + ".." + sTableName If Trim(sCondition) <> "" Then sSelectCommand += " WHERE " + sCondition End If 'Create a temporary view to hold data Try db.ExecuteImmediate("drop view Temp_View_For_Backup_001", SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default) Catch End Try db.ExecuteImmediate("create view Temp_View_For_Backup_001 as " + sSelectCommand, SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default) db.Views.Refresh() 'db.Views.Item("Temp_View_For_Backup_001").ExportData(objBCP) 'Export data to a file db.Views.Item("Temp_View_For_Backup_001").ExportData(objBCPExport) Try db.ExecuteImmediate("drop view Temp_View_For_Backup_001", SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default) Catch End Try End If

    D N V 3 Replies Last reply
    0
    • S Syed Naushad S

      If InStr(sTotalRows, "TOP 100 PERCENT *", CompareMethod.Text) > 0 And Trim(sCondition = "") Then 'If db.Tables.Item(sTableName).Rows > 0 Then db.Tables.Item(sTableName).ExportData(objBCPExport) 'End If Else Dim sSelectCommand As String = "select " + sTotalRows + " from " + sDatabaseName + ".." + sTableName If Trim(sCondition) <> "" Then sSelectCommand += " WHERE " + sCondition End If 'Create a temporary view to hold data Try db.ExecuteImmediate("drop view Temp_View_For_Backup_001", SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default) Catch End Try db.ExecuteImmediate("create view Temp_View_For_Backup_001 as " + sSelectCommand, SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default) db.Views.Refresh() 'db.Views.Item("Temp_View_For_Backup_001").ExportData(objBCP) 'Export data to a file db.Views.Item("Temp_View_For_Backup_001").ExportData(objBCPExport) Try db.ExecuteImmediate("drop view Temp_View_For_Backup_001", SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default) Catch End Try End If

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      There are lots of tools for this, but I assume no one is perfect. Do it manually.

      C isn't that hard: void (*(*f[])())() defines f as an array of unspecified size, of pointers to functions that return pointers to functions that return void "Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live." - Martin Golding

      1 Reply Last reply
      0
      • S Syed Naushad S

        If InStr(sTotalRows, "TOP 100 PERCENT *", CompareMethod.Text) > 0 And Trim(sCondition = "") Then 'If db.Tables.Item(sTableName).Rows > 0 Then db.Tables.Item(sTableName).ExportData(objBCPExport) 'End If Else Dim sSelectCommand As String = "select " + sTotalRows + " from " + sDatabaseName + ".." + sTableName If Trim(sCondition) <> "" Then sSelectCommand += " WHERE " + sCondition End If 'Create a temporary view to hold data Try db.ExecuteImmediate("drop view Temp_View_For_Backup_001", SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default) Catch End Try db.ExecuteImmediate("create view Temp_View_For_Backup_001 as " + sSelectCommand, SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default) db.Views.Refresh() 'db.Views.Item("Temp_View_For_Backup_001").ExportData(objBCP) 'Export data to a file db.Views.Item("Temp_View_For_Backup_001").ExportData(objBCPExport) Try db.ExecuteImmediate("drop view Temp_View_For_Backup_001", SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default) Catch End Try End If

        N Offline
        N Offline
        Nouman Bhatti
        wrote on last edited by
        #3

        First just write in simple english what this code does and then think how to write that in C# I think that's the simplest method

        1 Reply Last reply
        0
        • S Syed Naushad S

          If InStr(sTotalRows, "TOP 100 PERCENT *", CompareMethod.Text) > 0 And Trim(sCondition = "") Then 'If db.Tables.Item(sTableName).Rows > 0 Then db.Tables.Item(sTableName).ExportData(objBCPExport) 'End If Else Dim sSelectCommand As String = "select " + sTotalRows + " from " + sDatabaseName + ".." + sTableName If Trim(sCondition) <> "" Then sSelectCommand += " WHERE " + sCondition End If 'Create a temporary view to hold data Try db.ExecuteImmediate("drop view Temp_View_For_Backup_001", SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default) Catch End Try db.ExecuteImmediate("create view Temp_View_For_Backup_001 as " + sSelectCommand, SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default) db.Views.Refresh() 'db.Views.Item("Temp_View_For_Backup_001").ExportData(objBCP) 'Export data to a file db.Views.Item("Temp_View_For_Backup_001").ExportData(objBCPExport) Try db.ExecuteImmediate("drop view Temp_View_For_Backup_001", SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default) Catch End Try End If

          V Offline
          V Offline
          Vimalsoft Pty Ltd
          wrote on last edited by
          #4

          To Convert to C# from another Language you must Understand C#

          Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswam@its.co.za

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups