Creation of the DB2 database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KishorDhembare
    New Member
    • Apr 2010
    • 9

    #1

    Creation of the DB2 database

    Hi Everybody,

    I want to create a new DB2 Databse When My Application Start First Time tell me the solution for this.i have create database command but it can't run.



    Thanks.......in advance
  • MrMancunian
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    You really have to elaborate on your problem. What language, development environment, do you already have code? Does it give an error? What error?

    Steven

    Comment

    • KishorDhembare
      New Member
      • Apr 2010
      • 9

      #3
      Originally posted by MrMancunian
      You really have to elaborate on your problem. What language, development environment, do you already have code? Does it give an error? What error?

      Steven
      Code:
      Dim file As FileInfo = New FileInfo(Path.GetFullPath("TextFile1.txt"))
      Dim backupScript As String = file.OpenText.ReadToEnd()
      Dim strCommand As String = backupScript
      'Dim strConnection As String = "Driver={IBM DB2 ODBC DRIVER};Database=evaidya;Port=50000;Protocol=TCPIP ;Uid=db2Admin;Pwd=tatya;"
      Dim strConnection As String = "Provider=IBMDADB2;DSN=MyName;UID=MyID;PWD=MyPass; "
      
      
      Dim DBConnection As OleDbConnection = New OleDbConnection(strConnection)
      Dim cmdSoftware As New OleDbCommand(backupScript, DBConnection)
      DBConnection.Open()

      The File TextFile1.txt contain the command For database creation.....
      is :
      Code:
      CREATE DATABASE Temp AUTOMATIC STORAGE YES ON 'C:\' DBPATH ON 'C:\' USING CODESET IBM-1252 TERRITORY US COLLATE USING SYSTEM PAGESIZE 4096;
      Last edited by Frinavale; Apr 30 '10, 08:52 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        What is the problem?
        What is the error your getting?
        What is your program doing that is unexpected..or what isn't it doing that it is expected to do?

        -Frinny

        Comment

        Working...