-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: King John
Message 2 in Discussion
I dont know the Qracle in SQL Server it is like this.
BULK INSERT pbcr_regn_details_tbl FROM '" & arr & "' WITH ( FIELDTERMINATOR =
',',ROWTERMINATOR = '\n');
Public Sub BulkInsert(arr as String)
Dim CentreCode = session("Centrecode")
Dim DBConn = Application("DBConn")
Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim sqlstr as String = "delete from pbcr_regn_details_tbl where cc='" &
CentreCode & "'; delete from pbcr_regn_details_icd10_tbl where cc='" &
CentreCode & "';"
myConnection = New SqlConnection( DBConn )
myConnection.Open()
myCommand = New SqlCommand( sqlstr, myConnection )
myCommand.ExecuteNonQuery()
Try
Dim FILENAME as String = arr
Dim objStreamReader as StreamReader
Dim ReadLine as String
Dim SplitString
Dim ProcName
IF ICDCode.SelectedItem.Value = 9 Then
ProcName = " proc_insert_pbcr_regn_details_tbl "
Session("ICDCode") = "9"
Else
ProcName = " proc_insert_pbcr_regn_details_ICD10_tbl "
Session("ICDCode") = "10"
End If
objStreamReader = File.OpenText(FILENAME)
While objStreamReader.Peek() <> -1
ReadLine = objStreamReader.ReadLine()
SplitString = ReadLine.Split(",")
'For i = 0 To Str1.Length() - 1
'Response.Write(Str1(i) & "
")
'Next
IF SplitString.Length() >= 39 Then
sqlstr = "Execute " & ProcName & SplitString(0) & ","
& SplitString(1) & ",'" & SplitString(2) & "'," & SplitString(3) & ",'" &
SplitString(4) & "'," & SplitString(5) & "," & SplitString(5) & "," &
SplitString(7) & "," & SplitString(8) & "," & SplitString(9) & "," &
SplitString(10) & "," & SplitString(11) & "," & SplitString(12) & "," &
SplitString(13) & "," & SplitString(14) & "," & SplitString(15) & "," &
SplitString(16) & "," & SplitString(17) & "," & SplitString(18) & "," &
SplitString(19) & "," & SplitString(20) & "," & SplitString(21) & "," &
SplitString(22) & "," & SplitString(23) & "," & SplitString(24) & ",'" &
SplitString(25) & "'," & SplitString(26) & "," & SplitString(27) & "," &
SplitString(28) & "," & SplitString(29) & "," & SplitString(30) & "," &
SplitString(31) & "," & SplitString(32) & "," & SplitString(33) & "," &
SplitString(34) & "," & SplitString(35) & "," & SplitString(36) & "," &
SplitString(37) & "," & SplitString(38)
myCommand = New SqlCommand(sqlstr, myConnection )
myCommand.ExecuteNonQuery()
End IF
End While
objStreamReader.Close()
File.Delete(arr)
Catch e as System.Data.SqlClient.SqlException
lblMsg.Text = "Exporting data failed"
logEvents("Login : " & session("User") & " Export data failed" )
logEvents("Login : " & session("User") & " " & e.ToString())
Flag = 0
Finally
myConnection.Close()
End Try
End Sub
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]