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

Visual Basic

 
AnswerRe: Reading Complex Type from WSDL Pin
Brisingr Aerowing17-Nov-12 16:56
professionalBrisingr Aerowing17-Nov-12 16:56 
GeneralRe: Reading Complex Type from WSDL Pin
asv17-Nov-12 18:35
asv17-Nov-12 18:35 
QuestionSQL functions in VB Pin
NaseerKhanPattan17-Nov-12 6:28
NaseerKhanPattan17-Nov-12 6:28 
AnswerRe: SQL functions in VB Pin
Eddy Vluggen17-Nov-12 9:36
professionalEddy Vluggen17-Nov-12 9:36 
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 
Try this:
VB
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
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 
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 

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.