Click here to Skip to main content
15,921,454 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How To Copy Files To a Network computer in vb.net Pin
Dave Kreskowiak10-Feb-06 4:11
mveDave Kreskowiak10-Feb-06 4:11 
GeneralRe: How To Copy Files To a Network computer in vb.net Pin
Prasant_Panda10-Feb-06 20:54
Prasant_Panda10-Feb-06 20:54 
GeneralRe: How To Copy Files To a Network computer in vb.net Pin
Dave Kreskowiak11-Feb-06 3:28
mveDave Kreskowiak11-Feb-06 3:28 
GeneralRe: How To Copy Files To a Network computer in vb.net Pin
Prasant_Panda11-Feb-06 4:38
Prasant_Panda11-Feb-06 4:38 
GeneralRe: How To Copy Files To a Network computer in vb.net Pin
Dave Kreskowiak11-Feb-06 15:22
mveDave Kreskowiak11-Feb-06 15:22 
GeneralRe: How To Copy Files To a Network computer in vb.net Pin
Prasant_Panda12-Feb-06 17:17
Prasant_Panda12-Feb-06 17:17 
GeneralRe: How To Copy Files To a Network computer in vb.net Pin
Dave Kreskowiak13-Feb-06 16:43
mveDave Kreskowiak13-Feb-06 16:43 
QuestionMs Access Data Updation using VB.Net Pin
mayhem_rules9-Feb-06 18:06
mayhem_rules9-Feb-06 18:06 
VB.Net/MS Access. I need to insert records into a particular table (say X)after getting the data from two different tables (say A & B) and doing some permutations and combinations on it. I am getting entire data from tables A & B into two different Datasets. A loop has been written to parse the records from A (dataset), check in B(dataset) and insert the record in table C. However, this entire process is taking a long time. (i.e: in my test run, to insert around 8 lakh records, it took approx 4 hrs).
As per my perception, the time delay is being caused since I am firing an insert statement directly on the database during every loop cycle. Is there a way to avoid this and speed up the process. (i.e. Can the records be inserted into a dataset and then all the records be directly inserted into the table from the dataset)
I am providing sample code for your reference.
Code :
----------------------------------------------------------------------------
str = "select id, code, name, period from EMP2000"
ipcon.Open()
DA = New OleDbDataAdapter(str, ipcon)
DS = New DataSet
DA.Fill(DS, "irec")

str2 = "select id, code, addr, period from EMPADDR"
DA2 = New OleDbDataAdapter(str2, ipcon)
DS2 = New DataSet
DA2.Fill(DS2, "imsctrl")
DV = New DataView(DS2.Tables("imsctrl"))

str3 = "select Id, code, name, addr from EMPDATA where period = '2000'"
DA3 = New OleDbDataAdapter(str3, ipcon)
DS3 = New DataSet
DA3.Fill(DS3, "emp")
Dim cb As New OleDbCommandBuilder(DA3)

Dim cnt As Integer
cnt = 0
'''
Dim DataRow As DataRow
For Each myrow In DS.Tables("irec").Rows
If (myrow(1).Equals(System.DBNull.Value)) Then
code1 = ""
Else
code1 = myrow(1)
End If
If (myrow(3).Equals(System.DBNull.Value)) Then
period1 = ""
Else
period1 = myrow(3)
End If
If (myrow(2).Equals(System.DBNull.Value)) Then
name1 = ""
Else
name1 = myrow(2)
End If

For Each DataRow In DV.Table.Rows
If Trim(DataRow(1)) = Trim(code1) And Trim(DataRow(3)) = Trim(period1) Then
addr1 = Trim(DataRow(2))
Exit For
End If
Next
dsNewRow = DS3.Tables("emp").NewRow
dsNewRow.Item("code") = Trim(code1)
dsNewRow.Item("name") = trim(name1)
dsNewRow.Item("addr") = Trim(addr1)
DS3.Tables("emp").Rows.Add(dsNewRow)
DA3.Update(DS3, "emp")
Next
----------------------------------------------------------------------------

Is there a way to insert all the records in a dataset and finally update the dataset to the database? If there is such a way then is it really fast. Thnx for your help.

With Best Regards,

Mayur
AnswerRe: Ms Access Data Updation using VB.Net Pin
Dave Kreskowiak10-Feb-06 4:04
mveDave Kreskowiak10-Feb-06 4:04 
GeneralRe: Ms Access Data Updation using VB.Net Pin
mayhem_rules12-Feb-06 20:41
mayhem_rules12-Feb-06 20:41 
GeneralRe: Ms Access Data Updation using VB.Net Pin
Dave Kreskowiak13-Feb-06 16:54
mveDave Kreskowiak13-Feb-06 16:54 
QuestionQuestion on Word automation in VB.NET Pin
cylix20009-Feb-06 17:48
cylix20009-Feb-06 17:48 
QuestionDeveloping Office Application in dot net Pin
rahul_7608759-Feb-06 16:33
rahul_7608759-Feb-06 16:33 
AnswerRe: Developing Office Application in dot net Pin
Steve Pullan10-Feb-06 12:17
Steve Pullan10-Feb-06 12:17 
Questionwhat is this mean? Pin
pandapatin9-Feb-06 15:52
pandapatin9-Feb-06 15:52 
AnswerRe: what is this mean? Pin
Dave Kreskowiak9-Feb-06 16:07
mveDave Kreskowiak9-Feb-06 16:07 
AnswerRe: what is this mean? Pin
Steve Pullan10-Feb-06 12:10
Steve Pullan10-Feb-06 12:10 
Questionimplement interface Pin
bluey129-Feb-06 15:25
bluey129-Feb-06 15:25 
AnswerRe: implement interface Pin
Dave Kreskowiak9-Feb-06 16:16
mveDave Kreskowiak9-Feb-06 16:16 
GeneralRe: implement interface Pin
bluey1212-Feb-06 14:34
bluey1212-Feb-06 14:34 
GeneralRe: implement interface Pin
Dave Kreskowiak12-Feb-06 15:05
mveDave Kreskowiak12-Feb-06 15:05 
GeneralRe: implement interface Pin
bluey1213-Feb-06 19:54
bluey1213-Feb-06 19:54 
GeneralRe: implement interface Pin
Dave Kreskowiak14-Feb-06 2:25
mveDave Kreskowiak14-Feb-06 2:25 
Questionerror Pin
fmardani9-Feb-06 12:04
fmardani9-Feb-06 12:04 
AnswerRe: error Pin
fmardani9-Feb-06 12:09
fmardani9-Feb-06 12:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.