By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,261 Members | 1,688 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,261 IT Pros & Developers. It's quick & easy.

Creation of the DB2 database

P: 9
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
Apr 19 '10 #1
Share this Question
Share on Google+
3 Replies


MrMancunian
Expert 100+
P: 569
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
Apr 19 '10 #2

P: 9
@MrMancunian
Expand|Select|Wrap|Line Numbers
  1. Dim file As FileInfo = New FileInfo(Path.GetFullPath("TextFile1.txt"))
  2. Dim backupScript As String = file.OpenText.ReadToEnd()
  3. Dim strCommand As String = backupScript
  4. 'Dim strConnection As String = "Driver={IBM DB2 ODBC DRIVER};Database=evaidya;Port=50000;Protocol=TCPIP ;Uid=db2Admin;Pwd=tatya;"
  5. Dim strConnection As String = "Provider=IBMDADB2;DSN=MyName;UID=MyID;PWD=MyPass; "
  6.  
  7.  
  8. Dim DBConnection As OleDbConnection = New OleDbConnection(strConnection)
  9. Dim cmdSoftware As New OleDbCommand(backupScript, DBConnection)
  10. DBConnection.Open()

The File TextFile1.txt contain the command For database creation.....
is :
Expand|Select|Wrap|Line Numbers
  1. CREATE DATABASE Temp AUTOMATIC STORAGE YES ON 'C:\' DBPATH ON 'C:\' USING CODESET IBM-1252 TERRITORY US COLLATE USING SYSTEM PAGESIZE 4096;
Apr 21 '10 #3

Frinavale
Expert Mod 5K+
P: 9,731
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
Apr 30 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.