Click here to Skip to main content
15,892,298 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB.net Pin
Sathesh Sakthivel1-Jun-07 6:10
Sathesh Sakthivel1-Jun-07 6:10 
AnswerRe: VB.net Pin
Christian Graus1-Jun-07 10:35
protectorChristian Graus1-Jun-07 10:35 
Questionshutting my pc using VB command control Pin
shdtwen1-Jun-07 4:35
shdtwen1-Jun-07 4:35 
AnswerRe: shutting my pc using VB command control Pin
Dave Kreskowiak1-Jun-07 4:50
mveDave Kreskowiak1-Jun-07 4:50 
AnswerRe: shutting my pc using VB command control Pin
haggenx1-Jun-07 12:38
haggenx1-Jun-07 12:38 
GeneralRe: shutting my pc using VB command control Pin
Dave Kreskowiak1-Jun-07 13:21
mveDave Kreskowiak1-Jun-07 13:21 
GeneralRe: shutting my pc using VB command control Pin
Paul Conrad1-Jun-07 13:27
professionalPaul Conrad1-Jun-07 13:27 
QuestionDataSet writing errors Pin
Quecumber2561-Jun-07 3:33
Quecumber2561-Jun-07 3:33 
Can someone tell me the difference between these similar dataset writing routines?

The data writing subroutine:
Private Sub New_Bindings(ByVal intOrdinal As Integer, _
ByVal strCode As String, _
ByVal strName As String)

drCurrent = MyDataSet.Tables("tblBindings").NewRow()
drCurrent!Ordinal = intOrdinal
drCurrent!BindingCode = strCode
drCurrent!BindingName = strName
MyDataSet.Tables("tblBindings").Rows.Add(drCurrent)
Call Show_Changes("Sub New_Bindings", MyDataSet)
End Sub

After each row is written into the dataset I have another subroutine that prints out the results called Show_Changes.

Case one – The data is placed directly into the subroutine call.

I’m writing 5 rows to the dataset like this:
Call New_Bindings(1, "TST1", "Record 1")
Call New_Bindings(2, "TST2", "Record 2")
Call New_Bindings(3, "TST3", "Record 3")
Call New_Bindings(4, "TST4", "Record 4")
Call New_Bindings(5, "TST5", "Record 5")

Output screen results after each row addition:
Sub - Sub New_Bindings
TableName: tblBindings
1 TST1 1 Record 1
Sub - Sub New_Bindings
TableName: tblBindings
1 TST1 1 Record 1
2 TST2 2 Record 2
Sub - Sub New_Bindings
TableName: tblBindings
1 TST1 1 Record 1
2 TST2 2 Record 2
3 TST3 3 Record 3
Sub - Sub New_Bindings
TableName: tblBindings
1 TST1 1 Record 1
2 TST2 2 Record 2
3 TST3 3 Record 3
4 TST4 4 Record 4
Sub - Sub New_Bindings
TableName: tblBindings
1 TST1 1 Record 1
2 TST2 2 Record 2
3 TST3 3 Record 3
4 TST4 4 Record 4
5 TST5 5 Record 5

This works just fine. All the records have been written to the dataset and I can use the BindingNavigator control to go from record to record.

Case 2 – The data is placed into the subroutine via variables.
Call New_Bindings(CInt(txtOrdinal.Text), txtBindingCode.Text, txtBindingName.Text)

Output screen after the same five rows are added using the data entry form.
Sub - Sub New_Bindings
TableName: tblBindings
1 TST1 1 Record 1
Sub - Sub New_Bindings
TableName: tblBindings
1 TST2 2
2 TST2 2 Record 2
Sub - Sub New_Bindings
TableName: tblBindings
1 TST3 3
2 TST2 2 Record 2
3 TST3 3 Record 3
Sub - Sub New_Bindings
TableName: tblBindings
1 TST4 4
2 TST2 2 Record 2
3 TST3 3 Record 3
4 TST4 4 Record 4
Sub - Sub New_Bindings
TableName: tblBindings
1 TST5 5
2 TST2 2 Record 2
3 TST3 3 Record 3
4 TST4 4 Record 4
5 TST5 5 Record 5

As you can see the dataset is not the same. The method of data entry is the same, except that case 2 uses variables instead of literals. Obviously .NET handles these two similar data entry methods differently, but I haven’t a clue as to how or why this occurs.

Thanks,



Quecumber256
AnswerRe: DataSet writing errors Pin
Marcus J. Smith1-Jun-07 3:36
professionalMarcus J. Smith1-Jun-07 3:36 
GeneralRe: DataSet writing errors Pin
Quecumber2561-Jun-07 7:12
Quecumber2561-Jun-07 7:12 
Questionerror Pin
WhiteGirl231-Jun-07 3:30
WhiteGirl231-Jun-07 3:30 
AnswerRe: error Pin
Dave Kreskowiak1-Jun-07 4:11
mveDave Kreskowiak1-Jun-07 4:11 
GeneralRe: error Pin
WhiteGirl233-Jun-07 19:45
WhiteGirl233-Jun-07 19:45 
Questionenumerator Pin
Sonia Gupta1-Jun-07 3:18
Sonia Gupta1-Jun-07 3:18 
AnswerRe: enumerator Pin
Dave Kreskowiak1-Jun-07 4:09
mveDave Kreskowiak1-Jun-07 4:09 
QuestionA major problem in multi threading Monitor Class Pin
sabby20061-Jun-07 2:14
sabby20061-Jun-07 2:14 
QuestionExcel 2007 - Columns setting problem Pin
prashant pissey1-Jun-07 2:09
prashant pissey1-Jun-07 2:09 
QuestionSomething strange with DataGridView bound textboxes value submission... Pin
Marcus J. Smith1-Jun-07 1:40
professionalMarcus J. Smith1-Jun-07 1:40 
AnswerRe: Something strange with DataGridView bound textboxes value submission... Pin
kubben1-Jun-07 3:22
kubben1-Jun-07 3:22 
GeneralRe: Something strange with DataGridView bound textboxes value submission... Pin
Marcus J. Smith1-Jun-07 3:33
professionalMarcus J. Smith1-Jun-07 3:33 
GeneralRe: Something strange with DataGridView bound textboxes value submission... Pin
kubben1-Jun-07 3:44
kubben1-Jun-07 3:44 
GeneralRe: Something strange with DataGridView bound textboxes value submission... Pin
Marcus J. Smith1-Jun-07 3:52
professionalMarcus J. Smith1-Jun-07 3:52 
GeneralRe: Something strange with DataGridView bound textboxes value submission... Pin
Marcus J. Smith1-Jun-07 4:19
professionalMarcus J. Smith1-Jun-07 4:19 
Questiontextboxes in datagridview Pin
Sonia Gupta1-Jun-07 1:25
Sonia Gupta1-Jun-07 1:25 
AnswerRe: textboxes in datagridview Pin
Rupesh Kumar Swami1-Jun-07 1:35
Rupesh Kumar Swami1-Jun-07 1:35 

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.