|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Determining Column Number from Column Namedetermines the column name from the column number (5 in this example) from a single row table. ColName = tempA.Table.Columns(5).ColumnName() I can't figure out the code to return the column number if I have the column name. E.g., something like this: ColNumber = tempA.Table.ColumnName(Y1).ColumnNumber() Can someone point me in the right direction? Thanks Jeff Loop through the columns and do a If ....Then and if it equals the column
name you are looking for then you have your column number. Show quoteHide quote "Jeff" <n***@none.com> wrote in message news:458e8a4a$0$15523$88260bb3@free.teranews.com... > > In .net2 using VB (Visual Web), I have the following code that properly > determines the column name from the column number (5 in this example) from > a single row table. > > ColName = tempA.Table.Columns(5).ColumnName() > > I can't figure out the code to return the column number if I have the > column name. > > E.g., something like this: > > ColNumber = tempA.Table.ColumnName(Y1).ColumnNumber() > > Can someone point me in the right direction? > > Thanks > > Jeff > > > -- > Posted via a free Usenet account from http://www.teranews.com > "vbnetdev" <ad***@kjmsolutions.com> wrote in message Thanksnews:%23n6xI42JHHA.4068@TK2MSFTNGP03.phx.gbl... > Loop through the columns and do a If ....Then and if it equals the column > name you are looking for then you have your column number. After messing with this for a long while, I got the following to work. CurColNumber = tempA.Table.Columns.IndexOf(ColName) On Sun, 24 Dec 2006 09:04:43 -0600, Jeff wrote:
Show quoteHide quote > In .net2 using VB (Visual Web), I have the following code that properly DataColumns have an Ordinal property. Could this be what you are looking> determines the column name from the column number (5 in this example) from a > single row table. > > ColName = tempA.Table.Columns(5).ColumnName() > > I can't figure out the code to return the column number if I have the column > name. > > E.g., something like this: > > ColNumber = tempA.Table.ColumnName(Y1).ColumnNumber() > > Can someone point me in the right direction? > > Thanks > > Jeff for?
Goodbye microsoft.public.dotnet.languages.vb
overriding array size How to determine if e-mail was sent OK Add Active Directory Users to a Group on a Workstation Rename registry Key [folder/ branch] regex expressions MySQL and MyOleDB How to get the checked columns in DataGridView Deleting controls Autorun on USB Flash Drive |
|||||||||||||||||||||||