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

String manipulation

P: n/a
Hi experts,

I am writing a function to retrive a file from a folder. The database
stores the file name with .IN extension, and the file in the folder is
with .RET extension.
How do I change the file name's extension from
8000000136947_0000001_20041208_180636_BulkAcct.in to
8000000136947_0000001_20041208_180636_BulkAcct.RET

by programmatically?

say, the file name is stored in batch_table and column name is
File_Name, what should I do for strBatchFileName?

Thanks.
-----------------------------------------------------------------------
Public Function ProcessRET()
Dim EpayConnection As New SqlConnection
Dim cmdBatcheName As New SqlCommand
Dim dtrBatcheName As SqlDataReader
EpayConnection.ConnectionString = strEpayDBConn
With cmdBatcheName
.Connection = EpayConnection
.CommandText = "SELECT File_Name FROM Batch_Table Where
File_Status=2"
End With
Dim flRetBatch As File
Dim stRetBatch As FileStream
Dim smRetBatch As StreamReader
EpayConnection.Open()
dtrBatcheName = cmdBatcheName.ExecuteReader()
dtrBatcheName.Read()
Dim strFileName, strBatchFileName As String
strFileName = dtrBatcheName("File_Name")
strBatchFileName = ?
End Function

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
JenHu,

Can in a lot of way, however probably you are looking for this one

path changeextention

http://msdn.microsoft.com/library/de...nsiontopic.asp

I hope this helps?

Cor

"JenHu" <je**********@hotmail-dot-com.no-spam.invalid>
I am writing a function to retrive a file from a folder. The database
stores the file name with .IN extension, and the file in the folder is
with .RET extension.
How do I change the file name's extension from
8000000136947_0000001_20041208_180636_BulkAcct.in to
8000000136947_0000001_20041208_180636_BulkAcct.RET

by programmatically?

say, the file name is stored in batch_table and column name is
File_Name, what should I do for strBatchFileName?

Thanks.
-----------------------------------------------------------------------
Public Function ProcessRET()
Dim EpayConnection As New SqlConnection
Dim cmdBatcheName As New SqlCommand
Dim dtrBatcheName As SqlDataReader
EpayConnection.ConnectionString = strEpayDBConn
With cmdBatcheName
.Connection = EpayConnection
.CommandText = "SELECT File_Name FROM Batch_Table Where
File_Status=2"
End With
Dim flRetBatch As File
Dim stRetBatch As FileStream
Dim smRetBatch As StreamReader
EpayConnection.Open()
dtrBatcheName = cmdBatcheName.ExecuteReader()
dtrBatcheName.Read()
Dim strFileName, strBatchFileName As String
strFileName = dtrBatcheName("File_Name")
strBatchFileName = ?
End Function

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

Nov 21 '05 #2

P: n/a
strBatchFileName.Replace?

http://msdn.microsoft.com/library/de...placetopic.asp

Rgds,
Anand M
VB.NET MVP
http://www.dotnetindia.com

"JenHu" wrote:
Hi experts,

I am writing a function to retrive a file from a folder. The database
stores the file name with .IN extension, and the file in the folder is
with .RET extension.
How do I change the file name's extension from
8000000136947_0000001_20041208_180636_BulkAcct.in to
8000000136947_0000001_20041208_180636_BulkAcct.RET

by programmatically?

say, the file name is stored in batch_table and column name is
File_Name, what should I do for strBatchFileName?

Thanks.
-----------------------------------------------------------------------
Public Function ProcessRET()
Dim EpayConnection As New SqlConnection
Dim cmdBatcheName As New SqlCommand
Dim dtrBatcheName As SqlDataReader
EpayConnection.ConnectionString = strEpayDBConn
With cmdBatcheName
.Connection = EpayConnection
.CommandText = "SELECT File_Name FROM Batch_Table Where
File_Status=2"
End With
Dim flRetBatch As File
Dim stRetBatch As FileStream
Dim smRetBatch As StreamReader
EpayConnection.Open()
dtrBatcheName = cmdBatcheName.ExecuteReader()
dtrBatcheName.Read()
Dim strFileName, strBatchFileName As String
strFileName = dtrBatcheName("File_Name")
strBatchFileName = ?
End Function

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.