jesus4u Posted May 12, 2003 Posted May 12, 2003 I have a dataset filled with 1 and only 1 row in a table called Broadcasts. How do I read the value from the Title column? This errors out saying that there is no row at 0 or the same message if I change it to 1. Waz up?! dsCRH.Tables("Broadcasts").Rows(0)("Title") Quote Alex Polajenko
ailzaj Posted May 12, 2003 Posted May 12, 2003 This is code I used to populate a list box on form_load. dstClasses.Clear() adpClasses.Fill(dstClasses) ' dataset for ClassID list box tblClasses = dstClasses.Tables("Classes") ' load list box with values from ClassID column in Classes Table For i = 0 To tblClasses.Rows.Count - 1 lstClassID.Items.Add(tblClasses.Rows(i).Item("ClassID")) Next drwStudents = tblStudents.Rows(0) 'first row in table ailzaj Quote
sizer Posted May 12, 2003 Posted May 12, 2003 try with this --> dsCRH.Tables("Broadcasts").Rows(0).Items("Title") Quote Some people are wise and some are other-wise.
sizer Posted May 12, 2003 Posted May 12, 2003 CORRECTION!!!! dsCRH.Tables("Broadcasts").Rows(0).Item("Title") Quote Some people are wise and some are other-wise.
sizer Posted May 12, 2003 Posted May 12, 2003 dsCRH.Tables("Broadcasts").Rows(0).Item("Title") is equal to dsCRH.Tables("Broadcasts").Rows(0)("Title") so can you post some CODE !! Quote Some people are wise and some are other-wise.
*Experts* Nerseus Posted May 12, 2003 *Experts* Posted May 12, 2003 How can you be sure you have one row? Can you show us how you fill the DataSet? Also, use dsCRH.GetXml() to see all the data in your dataset. If it doesn't show anything, you have no data. You definitely want row 0, btw. All collections/arrays/etc. in .NET are 0-based. -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
*Experts* jfackler Posted May 14, 2003 *Experts* Posted May 14, 2003 Need code. Again: Show us how you fill the dataset. Quote
Heiko Posted May 14, 2003 Posted May 14, 2003 Probably the Dataset is empty, as has been mentioned before. Make use of the Direct Command Window Then test for dsCRSH.Tables.Count dsCRSH.Tables(0).TableName dsCRSH.Tables(0).Rows.Count and so on. Ups. GetXML sounds even better. *bows to Nerseus* Quote .nerd
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.