TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sean 0
NA
1
0
accessing a datarow's index ?
Jun 30 2004 10:49 AM
Hi There, I want to know how I can access a datarow's index property instead of looping through it ? I am trying to generate a table control from a stored procedure and I would like to have more control regrding the placement of values inside the control. Can someone help me out with the syntax please? Sean - thank in advance for your answer Dim dr As DataRow For Each dc In ds.Tables(0).Columns Dim trow As New TableRow() Dim tcellcolname As New TableCell() 'To Display the Column Names For Each dr In ds.Tables(0).Rows tcellcolname.Controls.Add(New LiteralControl(dc.ColumnName.ToString)) Next If Not dc.ColumnName = "ListingID" And Not dc.ColumnName = "model" And Not dc.ColumnName = "listprice" And Not dc.ColumnName = "descri" And Not dc.ColumnName = "manufacturer" And Not dc.ColumnName = "comments" And Not dc.ColumnName = "formname" And Not dc.ColumnName = "username" And Not dc.ColumnName = "lblquantity" And Not dc.ColumnName = "lbllistprice" And Not dc.ColumnName = "lblcomments" And Not dc.ColumnName = "lbllocation" And Not dc.ColumnName = "Location" Then trow.Cells.Add(tcellcolname) End if 'To Display the Column Data For Each dr In ds.Tables(0).Rows Dim tcellcoldata As New TableCell() If Not dc.ColumnName = "ListingID" And Not dc.ColumnName = "model" And Not dc.ColumnName = "listprice" And Not dc.ColumnName = "descri" And Not dc.ColumnName = "manufacturer" And Not dc.ColumnName = "comments" And Not dc.ColumnName = "formname" And Not dc.ColumnName = "username" And Not dc.ColumnName = "lblquantity" And Not dc.ColumnName = "lbllistprice" And Not dc.ColumnName = "lblcomments" And Not dc.ColumnName = "lbllocation" And Not dc.ColumnName = "Location" Then tcellcoldata.Controls.Add(New LiteralControl(dr(dc.ColumnName).ToString)) End if trow.Cells.Add(tcellcoldata) Next If Not dc.ColumnName = "ListingID" And Not dc.ColumnName = "model" And Not dc.ColumnName = "listprice" And Not dc.ColumnName = "descri" And Not dc.ColumnName = "manufacturer" And Not dc.ColumnName = "comments" And Not dc.ColumnName = "formname" And Not dc.ColumnName = "username" And Not dc.ColumnName = "lblquantity" And Not dc.ColumnName = "lbllistprice" And Not dc.ColumnName = "lblcomments" And Not dc.ColumnName = "lbllocation" And Not dc.ColumnName = "Location" Then Table1.Rows.Add(trow) End if Next
Reply
Answers (
1
)
error message in ado.net
typed and untyped datasets?