わかりました、ここに私のコードがあります:
Imports IBM.Data.DB2.iSeries
Module ConsoleData1
Sub Main()
'program identifier (to verify that you're using the right module)
Console.WriteLine("ConsoleData1.vb")
'create the connection object to the IBM i
Using cn As New iDB2Connection("DataSource=xxxxxxxxxxxxx")
Try
cn.Open()
Catch ex As iDB2Exception
Console.WriteLine("An error occurred on cn.Open()")
Exit Sub
End Try
'create a command object, initialize to valid SQL statement
Using cmd As New iDB2Command("select * from testlib.finishk", cn)
'create a command object, initialize to valid SQL statement
Console.Write("Enter the Color Code!==>")
Dim baldue = Console.ReadLine()
Dim sql As String = "Select * from testlib.finishk where FINCOD >=" & FINCOD
Using cmdx As New iDB2Command(sql, cn)
End Using
'create a data reader object, fill by executing the command
Try
Using dr As iDB2DataReader = cmd.ExecuteReader
'display data in a table
Console.Write("FINCOD" & vbTab)
Console.Write("FINDES" & vbTab)
While dr.Read()
Console.Write("{0}{1}", dr("FINCOD"), vbTab)
Console.Write("{0}{1}", dr("FINDES"), vbTab)
End While
End Using
Catch ex As iDB2Exception
Console.WriteLine("An error occurred on cmd.ExecuteReader()")
Exit Sub
End Try
End Using
End Using
Console.WriteLine("Press ENTER to end")
Console.ReadLine()
End Sub
Sub HandleError(ByVal errorOccurred As String, ByVal ex As iDB2Exception)
Console.WriteLine(errorOccurred)
Console.WriteLine("Source: {0}", ex.Source)
Console.WriteLine("SQLState: {0}", ex.SqlState)
Console.WriteLine("Message: {0}", ex.Message)
Console.WriteLine("MessageCode: {0}", ex.MessageCode)
Console.WriteLine("MessageDetails: {0}", ex.MessageDetails)
Console.ReadLine()
End Sub
Private Function Screen() As Object
Throw New NotImplementedException
End Function
End Module
では、cmd ウィンドウのサイズを大きくして、テーブル構造の整合性を維持できるようにするにはどうすればよいでしょうか。cmd ウィンドウのサイズを変更すると、誰かが値をウィンドウにランダムに配置したように見えてしまいます。
ありがとう。