|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DataTable Reading.....or name)? ..Net Framework 1.1 and VB.Net. I have the below code from documentation For Each thisTable In myDataSet.Tables ' For each row, print the values of each column. Dim myRow As DataRow For Each myRow In thisTable.Rows Dim myCol As DataColumn For Each myCol In thisTable.Columns Console.WriteLine(myRow(myCol)) Next myCol Next myRow Next thisTable But I wanted read the datatable data by referencing as above specified. Thank you, -Pete Pete Smith wrote:
Show quoteHide quote > What is the syntax to read the data from a DataTable by row # and (column # For Each thisTable In myDataSet.Tables> or name)? > > .Net Framework 1.1 and VB.Net. > > I have the below code from documentation > > > > For Each thisTable In myDataSet.Tables > ' For each row, print the values of each column. > Dim myRow As DataRow > For Each myRow In thisTable.Rows > Dim myCol As DataColumn > For Each myCol In thisTable.Columns > Console.WriteLine(myRow(myCol)) > Next myCol > Next myRow > Next thisTable > > But I wanted read the datatable data by referencing as above specified. > > > > Thank you, > > -Pete > > ' For each row, print the values of each column. Dim myRow As DataRow For Each myRow In thisTable.Rows Dim myCol As DataColumn For ii as integer = 0 to thisTable.Columns -1 Console.WriteLine(myRow(ii)) Next myCol Next myRow Next thisTable Chris wrote:
Show quoteHide quote > Pete Smith wrote: Oh, and your way doesn't work because a MyRow object does not contain a > >> What is the syntax to read the data from a DataTable by row # and >> (column # >> or name)? >> >> .Net Framework 1.1 and VB.Net. >> >> I have the below code from documentation >> >> >> >> For Each thisTable In myDataSet.Tables >> ' For each row, print the values of each column. >> Dim myRow As DataRow >> For Each myRow In thisTable.Rows >> Dim myCol As DataColumn >> For Each myCol In thisTable.Columns >> Console.WriteLine(myRow(myCol)) >> Next myCol >> Next myRow >> Next thisTable >> >> But I wanted read the datatable data by referencing as above specified. >> >> >> >> Thank you, >> >> -Pete >> >> > > For Each thisTable In myDataSet.Tables > ' For each row, print the values of each column. > Dim myRow As DataRow > For Each myRow In thisTable.Rows > Dim myCol As DataColumn > For ii as integer = 0 to thisTable.Columns -1 > Console.WriteLine(myRow(ii)) > Next myCol > Next myRow > Next thisTable DataColumn. Only the datatable contains a column object. Chris Thank you for the reply. But it did not answer my question fully.
-Pete Show quoteHide quote "Chris" <no@spam.com> wrote in message news:%233mfvsPMGHA.2604@TK2MSFTNGP09.phx.gbl... > Chris wrote: > > Pete Smith wrote: > > > >> What is the syntax to read the data from a DataTable by row # and > >> (column # > >> or name)? > >> > >> .Net Framework 1.1 and VB.Net. > >> > >> I have the below code from documentation > >> > >> > >> > >> For Each thisTable In myDataSet.Tables > >> ' For each row, print the values of each column. > >> Dim myRow As DataRow > >> For Each myRow In thisTable.Rows > >> Dim myCol As DataColumn > >> For Each myCol In thisTable.Columns > >> Console.WriteLine(myRow(myCol)) > >> Next myCol > >> Next myRow > >> Next thisTable > >> > >> But I wanted read the datatable data by referencing as above specified. > >> > >> > >> > >> Thank you, > >> > >> -Pete > >> > >> > > > > For Each thisTable In myDataSet.Tables > > ' For each row, print the values of each column. > > Dim myRow As DataRow > > For Each myRow In thisTable.Rows > > Dim myCol As DataColumn > > For ii as integer = 0 to thisTable.Columns -1 > > Console.WriteLine(myRow(ii)) > > Next myCol > > Next myRow > > Next thisTable > > > Oh, and your way doesn't work because a MyRow object does not contain a > DataColumn. Only the datatable contains a column object. > > Chris Pete Smith wrote:
Show quoteHide quote > Thank you for the reply. But it did not answer my question fully. What wasn't answered?> -Pete > > > "Chris" <no@spam.com> wrote in message > news:%233mfvsPMGHA.2604@TK2MSFTNGP09.phx.gbl... > >>Chris wrote: >> >>>Pete Smith wrote: >>> >>> >>>>What is the syntax to read the data from a DataTable by row # and >>>>(column # >>>>or name)? >>>> >>>>.Net Framework 1.1 and VB.Net. >>>> >>>>I have the below code from documentation >>>> >>>> >>>> >>>>For Each thisTable In myDataSet.Tables >>>> ' For each row, print the values of each column. >>>> Dim myRow As DataRow >>>> For Each myRow In thisTable.Rows >>>> Dim myCol As DataColumn >>>> For Each myCol In thisTable.Columns >>>> Console.WriteLine(myRow(myCol)) >>>> Next myCol >>>> Next myRow >>>> Next thisTable >>>> >>>>But I wanted read the datatable data by referencing as above specified. >>>> >>>> >>>> >>>>Thank you, >>>> >>>>-Pete >>>> >>>> >>> >>>For Each thisTable In myDataSet.Tables >>>' For each row, print the values of each column. >>> Dim myRow As DataRow >>> For Each myRow In thisTable.Rows >>> Dim myCol As DataColumn >>> For ii as integer = 0 to thisTable.Columns -1 >>> Console.WriteLine(myRow(ii)) >>> Next myCol >>> Next myRow >>>Next thisTable >> >> >>Oh, and your way doesn't work because a MyRow object does not contain a >>DataColumn. Only the datatable contains a column object. >> >>Chris > > > Is there anyway I can read cell(x,y) in the DataTable?
Thank you, -Pete Show quoteHide quote "Chris" <no@spam.com> wrote in message news:e9JlxTQMGHA.3732@TK2MSFTNGP10.phx.gbl... > Pete Smith wrote: > > Thank you for the reply. But it did not answer my question fully. > > -Pete > > > > > > "Chris" <no@spam.com> wrote in message > > news:%233mfvsPMGHA.2604@TK2MSFTNGP09.phx.gbl... > > > >>Chris wrote: > >> > >>>Pete Smith wrote: > >>> > >>> > >>>>What is the syntax to read the data from a DataTable by row # and > >>>>(column # > >>>>or name)? > >>>> > >>>>.Net Framework 1.1 and VB.Net. > >>>> > >>>>I have the below code from documentation > >>>> > >>>> > >>>> > >>>>For Each thisTable In myDataSet.Tables > >>>> ' For each row, print the values of each column. > >>>> Dim myRow As DataRow > >>>> For Each myRow In thisTable.Rows > >>>> Dim myCol As DataColumn > >>>> For Each myCol In thisTable.Columns > >>>> Console.WriteLine(myRow(myCol)) > >>>> Next myCol > >>>> Next myRow > >>>> Next thisTable > >>>> > >>>>But I wanted read the datatable data by referencing as above specified. > >>>> > >>>> > >>>> > >>>>Thank you, > >>>> > >>>>-Pete > >>>> > >>>> > >>> > >>>For Each thisTable In myDataSet.Tables > >>>' For each row, print the values of each column. > >>> Dim myRow As DataRow > >>> For Each myRow In thisTable.Rows > >>> Dim myCol As DataColumn > >>> For ii as integer = 0 to thisTable.Columns -1 > >>> Console.WriteLine(myRow(ii)) > >>> Next myCol > >>> Next myRow > >>>Next thisTable > >> > >> > >>Oh, and your way doesn't work because a MyRow object does not contain a > >>DataColumn. Only the datatable contains a column object. > >> > >>Chris > > > > > > > What wasn't answered? Pete Smith wrote:
Show quoteHide quote > Is there anyway I can read cell(x,y) in the DataTable? My example just showed you how to read every cell in the datatable.> Thank you, > -Pete > > "Chris" <no@spam.com> wrote in message > news:e9JlxTQMGHA.3732@TK2MSFTNGP10.phx.gbl... > >>Pete Smith wrote: >> >>>Thank you for the reply. But it did not answer my question fully. >>>-Pete >>> >>> >>>"Chris" <no@spam.com> wrote in message >>>news:%233mfvsPMGHA.2604@TK2MSFTNGP09.phx.gbl... >>> >>> >>>>Chris wrote: >>>> >>>> >>>>>Pete Smith wrote: >>>>> >>>>> >>>>> >>>>>>What is the syntax to read the data from a DataTable by row # and >>>>>>(column # >>>>>>or name)? >>>>>> >>>>>>.Net Framework 1.1 and VB.Net. >>>>>> >>>>>>I have the below code from documentation >>>>>> >>>>>> >>>>>> >>>>>>For Each thisTable In myDataSet.Tables >>>>>> ' For each row, print the values of each column. >>>>>> Dim myRow As DataRow >>>>>> For Each myRow In thisTable.Rows >>>>>> Dim myCol As DataColumn >>>>>> For Each myCol In thisTable.Columns >>>>>> Console.WriteLine(myRow(myCol)) >>>>>> Next myCol >>>>>> Next myRow >>>>>> Next thisTable >>>>>> >>>>>>But I wanted read the datatable data by referencing as above > > specified. > >>>>>> >>>>>> >>>>>>Thank you, >>>>>> >>>>>>-Pete >>>>>> >>>>>> >>>>> >>>>>For Each thisTable In myDataSet.Tables >>>>>' For each row, print the values of each column. >>>>> Dim myRow As DataRow >>>>> For Each myRow In thisTable.Rows >>>>> Dim myCol As DataColumn >>>>> For ii as integer = 0 to thisTable.Columns -1 >>>>> Console.WriteLine(myRow(ii)) >>>>> Next myCol >>>>> Next myRow >>>>>Next thisTable >>>> >>>> >>>>Oh, and your way doesn't work because a MyRow object does not contain a >>>>DataColumn. Only the datatable contains a column object. >>>> >>>>Chris >>> >>> >>> >>What wasn't answered? > > > To be more exact: myDataSet.Tables(Z).Rows(Y).Item(X) Chris Thank you,
-Pete Show quoteHide quote "Chris" <no@spam.com> wrote in message news:u$r3ffQMGHA.2528@TK2MSFTNGP12.phx.gbl... > Pete Smith wrote: > > Is there anyway I can read cell(x,y) in the DataTable? > > Thank you, > > -Pete > > > > "Chris" <no@spam.com> wrote in message > > news:e9JlxTQMGHA.3732@TK2MSFTNGP10.phx.gbl... > > > >>Pete Smith wrote: > >> > >>>Thank you for the reply. But it did not answer my question fully. > >>>-Pete > >>> > >>> > >>>"Chris" <no@spam.com> wrote in message > >>>news:%233mfvsPMGHA.2604@TK2MSFTNGP09.phx.gbl... > >>> > >>> > >>>>Chris wrote: > >>>> > >>>> > >>>>>Pete Smith wrote: > >>>>> > >>>>> > >>>>> > >>>>>>What is the syntax to read the data from a DataTable by row # and > >>>>>>(column # > >>>>>>or name)? > >>>>>> > >>>>>>.Net Framework 1.1 and VB.Net. > >>>>>> > >>>>>>I have the below code from documentation > >>>>>> > >>>>>> > >>>>>> > >>>>>>For Each thisTable In myDataSet.Tables > >>>>>> ' For each row, print the values of each column. > >>>>>> Dim myRow As DataRow > >>>>>> For Each myRow In thisTable.Rows > >>>>>> Dim myCol As DataColumn > >>>>>> For Each myCol In thisTable.Columns > >>>>>> Console.WriteLine(myRow(myCol)) > >>>>>> Next myCol > >>>>>> Next myRow > >>>>>> Next thisTable > >>>>>> > >>>>>>But I wanted read the datatable data by referencing as above > > > > specified. > > > >>>>>> > >>>>>> > >>>>>>Thank you, > >>>>>> > >>>>>>-Pete > >>>>>> > >>>>>> > >>>>> > >>>>>For Each thisTable In myDataSet.Tables > >>>>>' For each row, print the values of each column. > >>>>> Dim myRow As DataRow > >>>>> For Each myRow In thisTable.Rows > >>>>> Dim myCol As DataColumn > >>>>> For ii as integer = 0 to thisTable.Columns -1 > >>>>> Console.WriteLine(myRow(ii)) > >>>>> Next myCol > >>>>> Next myRow > >>>>>Next thisTable > >>>> > >>>> > >>>>Oh, and your way doesn't work because a MyRow object does not contain a > >>>>DataColumn. Only the datatable contains a column object. > >>>> > >>>>Chris > >>> > >>> > >>> > >>What wasn't answered? > > > > > > > > My example just showed you how to read every cell in the datatable. > > To be more exact: > myDataSet.Tables(Z).Rows(Y).Item(X) > > Chris |
|||||||||||||||||||||||