Click here to Skip to main content
15,885,899 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionFinding a Row in a Datatable and putting the row to variables Pin
JRHibner14-Nov-12 18:37
JRHibner14-Nov-12 18:37 
AnswerRe: Finding a Row in a Datatable and putting the row to variables Pin
Andy_L_J15-Nov-12 19:48
Andy_L_J15-Nov-12 19:48 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner18-Nov-12 16:15
JRHibner18-Nov-12 16:15 
AnswerRe: Finding a Row in a Datatable and putting the row to variables Pin
Andy_L_J18-Nov-12 20:45
Andy_L_J18-Nov-12 20:45 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner18-Nov-12 20:55
JRHibner18-Nov-12 20:55 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
Andy_L_J18-Nov-12 21:33
Andy_L_J18-Nov-12 21:33 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner18-Nov-12 21:36
JRHibner18-Nov-12 21:36 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner27-Nov-12 19:28
JRHibner27-Nov-12 19:28 
Thanks again for all the help.

Your questions leads me to my next one. In the above example I'm using a value from one table to find the row in another and then load those values to a form. So in that example there will always be a value in the second table due to the way the data is saved.

Now when I save the row to the database, I want to check and see if the item already exists and if I should update it or save it as a new record.

I've been using the following code to search the table before saving to determine if I need to save it or update the record.

sStringTemp = "Item = '" & MTBGeneLabel.Text & "'"
Dim tRow() As DataRow = tPlazimorphGenes.Select(sStringTemp)
If tRow(0).Item(0) Is DBNull.Value Then
SaveItemRecord(uUniqueID)
Else
UpdateItemRecord(uUniqueID)
End if

I bolded the section that is giving me issues. Trying to test if the row exists or if it's Null. I've tried quite a few variations from tutorials and answers for similar questions I found online.
AnswerRe: Finding a Row in a Datatable and putting the row to variables Pin
Andy_L_J27-Nov-12 20:56
Andy_L_J27-Nov-12 20:56 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner27-Nov-12 23:40
JRHibner27-Nov-12 23:40 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
Andy_L_J28-Nov-12 0:20
Andy_L_J28-Nov-12 0:20 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner28-Nov-12 10:35
JRHibner28-Nov-12 10:35 
QuestionChanging Assembly Properties through Reflection Pin
Dominick Marciano14-Nov-12 9:38
professionalDominick Marciano14-Nov-12 9:38 
AnswerRe: Changing Assembly Properties through Reflection Pin
Eddy Vluggen15-Nov-12 1:18
professionalEddy Vluggen15-Nov-12 1:18 
GeneralRe: Changing Assembly Properties through Reflection Pin
Dominick Marciano15-Nov-12 17:14
professionalDominick Marciano15-Nov-12 17:14 
GeneralRe: Changing Assembly Properties through Reflection Pin
Eddy Vluggen16-Nov-12 0:06
professionalEddy Vluggen16-Nov-12 0:06 
Questionmessagebeep Pin
Gil Goodridge14-Nov-12 8:00
Gil Goodridge14-Nov-12 8:00 
AnswerRe: messagebeep Pin
Dave Kreskowiak14-Nov-12 8:31
mveDave Kreskowiak14-Nov-12 8:31 
QuestionRijndael encryption not working Pin
maskrtnik0114-Nov-12 2:20
maskrtnik0114-Nov-12 2:20 
AnswerRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 2:52
professionalKeith Barrow14-Nov-12 2:52 
GeneralRe: Rijndael encryption not working Pin
maskrtnik0114-Nov-12 3:08
maskrtnik0114-Nov-12 3:08 
GeneralRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 3:26
professionalKeith Barrow14-Nov-12 3:26 
GeneralRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 3:35
professionalKeith Barrow14-Nov-12 3:35 
GeneralRe: Rijndael encryption not working Pin
maskrtnik0114-Nov-12 3:48
maskrtnik0114-Nov-12 3:48 
GeneralRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 4:05
professionalKeith Barrow14-Nov-12 4:05 

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.