Click here to Skip to main content
11,412,833 members (74,117 online)

Visual Basic

 
AnswerRe: Controlling Monitor brightness from VB6 Pin
Simon_Whale at 20-Nov-12 1:12
memberSimon_Whale20-Nov-12 1:12 
QuestionExport Data from Gridview to Sql Server Pin
Naga Raju Vutla at 18-Nov-12 19:22
memberNaga Raju Vutla18-Nov-12 19:22 
AnswerRe: Export Data from Gridview to Sql Server Pin
Eddy Vluggen at 19-Nov-12 1:01
memberEddy Vluggen19-Nov-12 1:01 
AnswerRe: Export Data from Gridview to Sql Server Pin
Bert Mitton at 19-Nov-12 9:21
memberBert Mitton19-Nov-12 9:21 
GeneralRe: Export Data from Gridview to Sql Server Pin
Eddy Vluggen at 19-Nov-12 10:48
memberEddy Vluggen19-Nov-12 10:48 
QuestionReading Complex Type from WSDL Pin
asv at 17-Nov-12 15:47
memberasv17-Nov-12 15:47 
AnswerRe: Reading Complex Type from WSDL Pin
Zac Greve at 17-Nov-12 17:56
memberZac Greve17-Nov-12 17:56 
GeneralRe: Reading Complex Type from WSDL Pin
asv at 17-Nov-12 19:35
memberasv17-Nov-12 19:35 
QuestionSQL functions in VB Pin
NaseerKhanPattan at 17-Nov-12 7:28
memberNaseerKhanPattan17-Nov-12 7:28 
AnswerRe: SQL functions in VB Pin
Eddy Vluggen at 17-Nov-12 10:36
memberEddy Vluggen17-Nov-12 10:36 
QuestionFinding a Row in a Datatable and putting the row to variables Pin
JRHibner at 14-Nov-12 19:37
memberJRHibner14-Nov-12 19:37 
AnswerRe: Finding a Row in a Datatable and putting the row to variables Pin
Andy_L_J at 15-Nov-12 20:48
memberAndy_L_J15-Nov-12 20:48 
GeneralRe: Finding a Row in a Datatable and putting the row to variables [modified] Pin
JRHibner at 18-Nov-12 17:15
memberJRHibner18-Nov-12 17:15 
AnswerRe: Finding a Row in a Datatable and putting the row to variables Pin
Andy_L_J at 18-Nov-12 21:45
memberAndy_L_J18-Nov-12 21: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
JRHibner at 18-Nov-12 21:55
memberJRHibner18-Nov-12 21:55 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
Andy_L_J at 18-Nov-12 22:33
memberAndy_L_J18-Nov-12 22:33 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner at 18-Nov-12 22:36
memberJRHibner18-Nov-12 22:36 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner at 27-Nov-12 20:28
memberJRHibner27-Nov-12 20:28 
AnswerRe: Finding a Row in a Datatable and putting the row to variables Pin
Andy_L_J at 27-Nov-12 21:56
memberAndy_L_J27-Nov-12 21:56 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner at 28-Nov-12 0:40
memberJRHibner28-Nov-12 0:40 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
Andy_L_J at 28-Nov-12 1:20
memberAndy_L_J28-Nov-12 1:20 
GeneralRe: Finding a Row in a Datatable and putting the row to variables Pin
JRHibner at 28-Nov-12 11:35
memberJRHibner28-Nov-12 11:35 
QuestionChanging Assembly Properties through Reflection Pin
DisIsHoody at 14-Nov-12 10:38
memberDisIsHoody14-Nov-12 10:38 
AnswerRe: Changing Assembly Properties through Reflection Pin
Eddy Vluggen at 15-Nov-12 2:18
memberEddy Vluggen15-Nov-12 2:18 
GeneralRe: Changing Assembly Properties through Reflection Pin
DisIsHoody at 15-Nov-12 18:14
memberDisIsHoody15-Nov-12 18:14 
GeneralRe: Changing Assembly Properties through Reflection Pin
Eddy Vluggen at 16-Nov-12 1:06
memberEddy Vluggen16-Nov-12 1:06 
Questionmessagebeep Pin
Gil Goodridge at 14-Nov-12 9:00
memberGil Goodridge14-Nov-12 9:00 
AnswerRe: messagebeep Pin
Dave Kreskowiak at 14-Nov-12 9:31
mvpDave Kreskowiak14-Nov-12 9:31 
QuestionRijndael encryption not working Pin
maskrtnik01 at 14-Nov-12 3:20
membermaskrtnik0114-Nov-12 3:20 
AnswerRe: Rijndael encryption not working Pin
Keith Barrow at 14-Nov-12 3:52
mentorKeith Barrow14-Nov-12 3:52 
GeneralRe: Rijndael encryption not working Pin
maskrtnik01 at 14-Nov-12 4:08
membermaskrtnik0114-Nov-12 4:08 
GeneralRe: Rijndael encryption not working Pin
Keith Barrow at 14-Nov-12 4:26
mentorKeith Barrow14-Nov-12 4:26 
GeneralRe: Rijndael encryption not working Pin
Keith Barrow at 14-Nov-12 4:35
mentorKeith Barrow14-Nov-12 4:35 
GeneralRe: Rijndael encryption not working Pin
maskrtnik01 at 14-Nov-12 4:48
membermaskrtnik0114-Nov-12 4:48 
GeneralRe: Rijndael encryption not working Pin
Keith Barrow at 14-Nov-12 5:05
mentorKeith Barrow14-Nov-12 5:05 
QuestionRe: Rijndael encryption not working [modified] Pin
maskrtnik01 at 15-Nov-12 20:40
membermaskrtnik0115-Nov-12 20:40 
GeneralRe: Rijndael encryption not working Pin
DisIsHoody at 14-Nov-12 10:34
memberDisIsHoody14-Nov-12 10:34 
GeneralRe: Rijndael encryption not working Pin
maskrtnik01 at 14-Nov-12 19:21
membermaskrtnik0114-Nov-12 19:21 
AnswerRe: Rijndael encryption not working Pin
DisIsHoody at 15-Nov-12 18:37
memberDisIsHoody15-Nov-12 18:37 
GeneralRe: Rijndael encryption not working Pin
maskrtnik01 at 15-Nov-12 20:37
membermaskrtnik0115-Nov-12 20:37 
QuestionRetrive date from sql server in system date format in VB6 application by a one time setting Pin
Johnson Antony at 13-Nov-12 14:34
memberJohnson Antony13-Nov-12 14:34 
AnswerRe: Retrive date from sql server in system date format in VB6 application by a one time setting Pin
Dave Kreskowiak at 13-Nov-12 15:00
mvpDave Kreskowiak13-Nov-12 15:00 
QuestionHow to find out if a file is in use before reading the data in that file Pin
KreativeKai at 13-Nov-12 8:47
memberKreativeKai13-Nov-12 8:47 
AnswerRe: How to find out if a file is in use before reading the data in that file Pin
Dave Kreskowiak at 13-Nov-12 9:09
mvpDave Kreskowiak13-Nov-12 9:09 
GeneralRe: How to find out if a file is in use before reading the data in that file Pin
KreativeKai at 13-Nov-12 9:22
memberKreativeKai13-Nov-12 9:22 
GeneralRe: How to find out if a file is in use before reading the data in that file Pin
KreativeKai at 13-Nov-12 9:46
memberKreativeKai13-Nov-12 9:46 
AnswerRe: How to find out if a file is in use before reading the data in that file Pin
KreativeKai at 13-Nov-12 9:13
memberKreativeKai13-Nov-12 9:13 
GeneralRe: How to find out if a file is in use before reading the data in that file [modified] Pin
Dave Kreskowiak at 13-Nov-12 10:57
mvpDave Kreskowiak13-Nov-12 10:57 
AnswerRe: How to find out if a file is in use before reading the data in that file Pin
Eddy Vluggen at 13-Nov-12 12:41
memberEddy Vluggen13-Nov-12 12:41 
GeneralRe: How to find out if a file is in use before reading the data in that file Pin
KreativeKai at 14-Nov-12 2:37
memberKreativeKai14-Nov-12 2:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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 | Mobile
Web04 | 2.8.150427.1 | Last Updated 25 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid