Click here to Skip to main content
15,895,656 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: My SQl adapter is not behaving normal Pin
Vimalsoft(Pty) Ltd2-Jan-08 9:11
professionalVimalsoft(Pty) Ltd2-Jan-08 9:11 
GeneralRe: My SQl adapter is not behaving normal Pin
Dave Kreskowiak2-Jan-08 9:32
mveDave Kreskowiak2-Jan-08 9:32 
GeneralRe: My SQl adapter is not behaving normal Pin
Vimalsoft(Pty) Ltd3-Jan-08 5:13
professionalVimalsoft(Pty) Ltd3-Jan-08 5:13 
GeneralVB.NET Multithreading question [modified] Pin
SimulationofSai2-Jan-08 0:49
SimulationofSai2-Jan-08 0:49 
GeneralRe: VB.NET Multithreading question Pin
Dave Kreskowiak2-Jan-08 7:44
mveDave Kreskowiak2-Jan-08 7:44 
GeneralRe: VB.NET Multithreading question Pin
SimulationofSai2-Jan-08 18:28
SimulationofSai2-Jan-08 18:28 
GeneralRe: VB.NET Multithreading question Pin
Dave Kreskowiak3-Jan-08 6:56
mveDave Kreskowiak3-Jan-08 6:56 
Generalslow performance on 1st add new row to datatable Pin
Eunice (VB junior)1-Jan-08 22:32
Eunice (VB junior)1-Jan-08 22:32 
Hi Everyone,

I am writing a vb.net window application. I want to add some rows into datatable.
The problem I am having is when i first add a new row to the datatable, I get very
slow performance (20-30 second delay). The add to datatable works but I
get slow performance. Any record adds or deletes after this first add
are fast. I get slow performance on the first add. I have no idea what
is causing this slow performance. I cannot figure out what is
delaying the add. Any thoughts on where I might be going wrong?
Thanks in advanced.

Here is my codes:-

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
If myTable Is Nothing Then InitGrid()

Dim Row As DataRow
Try

For Each Row In myTable.Rows
If Row.Item("HBarCode").ToString = Me.txtHBarCode.Text Then
MessageBox.Show("Housing Serial Number already scanned.Duplicated.")
txtHBarCode.Focus()
Exit Sub
End If

If Row.Item("EMIBarCode").ToString = Me.txtEMIBarCode.Text Then
MessageBox.Show("EMI Serial Number already scanned.Duplicated.")
txtEMIBarCode.Focus()
Exit Sub
End If
Next

Row = myTable.NewRow()
Me.txtCounter.Text = myTable.Rows.Count + 1
Row.Item("HBarCode") = Me.txtHBarCode.Text
Row.Item("EMIBarCode") = Me.txtEMIBarCode.Text

'to check any colume without data, then only add row at myTable
If Me.txtHBarCode.Text.Trim.Length = 0 Then
MessageBox.Show("Please Scan in Housing BarCode.")
Me.txtHBarCode.Focus()
Exit Sub
End If

If Me.txtEMIBarCode.Text.Trim.Length = 0 Then
MessageBox.Show("Please Scan in EMI BarCode.")
Me.txtEMIBarCode.Focus()
Exit Sub
End If

myTable.Rows.Add(Row)
Me.txtHBarCode.Text = ""
Me.txtEMIBarCode.Text = ""
Me.txtHBarCode.Focus()

If Me.txtCounter.Text = Me.txtQty.Text Then
txtQty.Enabled = False
btnComplete.Enabled = True
txtHBarCode.Enabled = False
txtEMIBarCode.Enabled = False
End If

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

dgResult.Update()

End Sub



Public Sub InitGrid()

myTable = New DataTable("LotNumber")

Dim HBarCode As DataColumn = New DataColumn("HBarCode")
HBarCode.DataType = System.Type.GetType("System.String")
myTable.Columns.Add(HBarCode)

Dim EMIBarCode As DataColumn = New DataColumn("EMIBarCode")
EMIBarCode.DataType = System.Type.GetType("System.String")
myTable.Columns.Add(EMIBarCode)

ds = New DataSet
ds.Tables.Add(myTable)
dgResult.SetDataBinding(ds, "LotNumber")

End Sub

thanks,eunice
GeneralRe: slow performance on 1st add new row to datatable Pin
Dave Kreskowiak2-Jan-08 7:37
mveDave Kreskowiak2-Jan-08 7:37 
Generalsecurity issue Pin
Tauseef A1-Jan-08 22:32
Tauseef A1-Jan-08 22:32 
GeneralRe: security issue Pin
Vimalsoft(Pty) Ltd2-Jan-08 3:01
professionalVimalsoft(Pty) Ltd2-Jan-08 3:01 
Questionhow can i append one word file to another Pin
koolprasad20031-Jan-08 19:17
professionalkoolprasad20031-Jan-08 19:17 
AnswerRe: how can i append one word file to another Pin
Vimalsoft(Pty) Ltd2-Jan-08 3:06
professionalVimalsoft(Pty) Ltd2-Jan-08 3:06 
Generalhelp for folder compression Pin
Senthil S1-Jan-08 19:17
Senthil S1-Jan-08 19:17 
GeneralRe: help for folder compression [modified] Pin
Nilesh Hapse1-Jan-08 23:59
Nilesh Hapse1-Jan-08 23:59 
GeneralCreate custom folder while setup my application Pin
Mekong River1-Jan-08 15:56
Mekong River1-Jan-08 15:56 
GeneralRe: Create custom folder while setup my application Pin
Dave Kreskowiak2-Jan-08 5:07
mveDave Kreskowiak2-Jan-08 5:07 
GeneralRe: Create custom folder while setup my application Pin
Mekong River2-Jan-08 17:53
Mekong River2-Jan-08 17:53 
QuestionHow to view an msg file? Pin
ninkk1-Jan-08 4:51
ninkk1-Jan-08 4:51 
AnswerRe: How to view an msg file? Pin
Dave Kreskowiak2-Jan-08 4:58
mveDave Kreskowiak2-Jan-08 4:58 
QuestionPictureBox SizeMode Pin
nishkarsh_k1-Jan-08 2:04
nishkarsh_k1-Jan-08 2:04 
GeneralRe: PictureBox SizeMode Pin
Dave Kreskowiak1-Jan-08 11:06
mveDave Kreskowiak1-Jan-08 11:06 
GeneralRe: PictureBox SizeMode Pin
nishkarsh_k2-Jan-08 18:08
nishkarsh_k2-Jan-08 18:08 
Questionsave images into access Pin
poonams1-Jan-08 0:59
poonams1-Jan-08 0:59 
GeneralRe: save images into access Pin
Michael Sync1-Jan-08 1:10
Michael Sync1-Jan-08 1:10 

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.