Click here to Skip to main content
13,189,324 members (75,414 online)

Visual Basic

 
AnswerRe: Reading Complex Type from WSDL Pin
Zac Greve17-Nov-12 16:56
memberZac Greve17-Nov-12 16:56 
GeneralRe: Reading Complex Type from WSDL Pin
asv17-Nov-12 18:35
memberasv17-Nov-12 18:35 
QuestionSQL functions in VB Pin
NaseerKhanPattan17-Nov-12 6:28
memberNaseerKhanPattan17-Nov-12 6:28 
AnswerRe: SQL functions in VB Pin
Eddy Vluggen17-Nov-12 9:36
memberEddy Vluggen17-Nov-12 9:36 
QuestionFinding a Row in a Datatable and putting the row to variables Pin
JRHibner14-Nov-12 18:37
memberJRHibner14-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
memberAndy_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
memberJRHibner18-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
memberAndy_L_J18-Nov-12 20:45 
Try this:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  Dim dt As New DataTable
  With dt
    .Columns.Add("Name")
    .Columns.Add("Address")
    .Columns.Add("Salary")
    .Rows.Add(New Object() {"John", "123 Some Street", 1234})
    .Rows.Add(New Object() {"Frank", "15 TheOther Street", 1400})
    .Rows.Add(New Object() {"Harry", "3 No Street", 450})
  End With
 
  Dim dr As DataRow = GetDataRow(dt, "John")
  Label1.Text = String.Format("Name = {0}{3}Address = {1}{3}Salary = {2}",
				 dr("Name").ToString, dr("Address").ToString, dr("Salary").ToString, vbCrLf)
End Sub
 
Private Function GetDataRow(ByVal dt As DataTable, ByVal name As String) As DataRow
  Dim sStringTemp2 = "Name = '" + name + "'"
  Dim tRow As DataRow() = dt.Select(sStringTemp2)
  Return tRow(0)
End Function

Note that your tRow object is an Array; Dim tRow as DataRow(), so we returned the first result, you may need to iterate through the array if there ismore than one result returned from the Select method.

Hope this helps. Big Grin | :-D
I don't speak Idiot - please talk slowly and clearly

"I have sexdaily. I mean dyslexia. Fcuk!"

Driven to the arms of Heineken by the wife

GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner18-Nov-12 20:55
memberJRHibner18-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
memberAndy_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
memberJRHibner18-Nov-12 21:36 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner27-Nov-12 19:28
memberJRHibner27-Nov-12 19:28 
AnswerRe: Finding a Row in a Datatable and putting the row to variables Pin
Andy_L_J27-Nov-12 20:56
memberAndy_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
memberJRHibner27-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
memberAndy_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
memberJRHibner28-Nov-12 10:35 
QuestionChanging Assembly Properties through Reflection Pin
DisIsHoody14-Nov-12 9:38
memberDisIsHoody14-Nov-12 9:38 
AnswerRe: Changing Assembly Properties through Reflection Pin
Eddy Vluggen15-Nov-12 1:18
memberEddy Vluggen15-Nov-12 1:18 
GeneralRe: Changing Assembly Properties through Reflection Pin
DisIsHoody15-Nov-12 17:14
memberDisIsHoody15-Nov-12 17:14 
GeneralRe: Changing Assembly Properties through Reflection Pin
Eddy Vluggen16-Nov-12 0:06
memberEddy Vluggen16-Nov-12 0:06 
Questionmessagebeep Pin
Gil Goodridge14-Nov-12 8:00
memberGil Goodridge14-Nov-12 8:00 
AnswerRe: messagebeep Pin
Dave Kreskowiak14-Nov-12 8:31
mvpDave Kreskowiak14-Nov-12 8:31 
QuestionRijndael encryption not working Pin
maskrtnik0114-Nov-12 2:20
membermaskrtnik0114-Nov-12 2:20 
AnswerRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 2:52
mentorKeith Barrow14-Nov-12 2:52 
GeneralRe: Rijndael encryption not working Pin
maskrtnik0114-Nov-12 3:08
membermaskrtnik0114-Nov-12 3:08 

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.


Advertise | Privacy |
Web03 | 2.8.171016.2 | Last Updated 16 Oct 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid