Hi all,
I want to retrieve data from database and generate a string line
with fix length characters, so I can put into a file. But this is
the first time I am writing module besides ASP.NET. I need help from
you.
I wrote the code like this, and I don't how to put into a string
line........can someone show me how to do it.
The output should like this:
738487827 Baston Mary
Thanks.
Imports System.Data
Imports System.Data.SqlClient
Module Module1
Dim GPConnection As SqlConnection
Dim GPCommand As SqlCommand
Dim dr As SqlDataReader
Sub Main()
Dim EmpID(10) As Char
Dim LName(30) As Char
Dim FName(30) As Char
Try
GPConnection = New SqlConnection("data
source=AMKSQL2;initial log=EPAY;password=123")
GPConnection.Open()
GPCommand = New SqlCommand("SELECT
EMPLOYID,LASTNAME,FRSTNAME FROM UPR00102", GPConnection)
dr = GPCommand.ExecuteReader
Dim InFile As String
InFile += GenerateARecord(EmpID, LName, FName)
Catch
End Try
dr.Close()
GPConnection.Close()
End Sub
Function GenerateARecord(ByVal strEmpID As String, ByVal strLName
As String, ByVal strFName As String)
End Function
End Module
*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*