CopyPastor

Detecting plagiarism made easy.

Score: 0.8464505076408386; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2013-10-22
by ketan italiya

Original Post

Original - Posted on 2013-10-22
by ketan italiya



            
Present in both answers; Present only in the new answer; Present only in the old answer;

try this c# code,
DimobjEXCELCon As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=EXCLE_FILE_PATH;Extended Properties=""Excel 12.0 Xml;HDR=Yes""") ExcelConnection.Open() Dim objQuery As String = "SELECT * FROM [Sheet1$]" 'get values from sheet1, here you can change your sheet name Dim objCMD As OleDbCommand = New OleDbCommand(objQuery,objEXCELCon) Dim objDR As OleDbDataReader Dim SQLconn As New SqlConnection() Dim szCON As String = "Connection string for database" SQLconn.ConnectionString = szCON SQLconn.Open() Using bulkCopy As SqlBulkCopy = New SqlBulkCopy(SQLConn) bulkCopy.DestinationTableName = "TableToWriteToInSQLSERVER" Try objDR = objCMD.ExecuteReader bulCopy.WriteToServer(objDR) objDR.Close() SQLConn.Close() Catch ex As Exception MsgBox(ex.ToString) End Try
use this code for that,
DimobjEXCELCon As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=EXCLE_FILE_PATH;Extended Properties=""Excel 12.0 Xml;HDR=Yes""") ExcelConnection.Open() Dim objQuery As String = "SELECT * FROM [Sheet1$]" 'get values from sheet1, here you can change your sheet name Dim objCMD As OleDbCommand = New OleDbCommand(objQuery,objEXCELCon) Dim objDR As OleDbDataReader Dim SQLconn As New SqlConnection() Dim szCON As String = "Connection string for database" SQLconn.ConnectionString = szCON SQLconn.Open() Using bulkCopy As SqlBulkCopy = New SqlBulkCopy(SQLConn) bulkCopy.DestinationTableName = "TableToWriteToInSQLSERVER" Try objDR = objCMD.ExecuteReader bulCopy.WriteToServer(objDR) objDR.Close() SQLConn.Close() Catch ex As Exception MsgBox(ex.ToString) End Try

        
Present in both answers; Present only in the new answer; Present only in the old answer;