473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

There is no row at position 0

Hi Friends,
There is no row at position 0 Error
here it is my code..
Expand|Select|Wrap|Line Numbers
  1. string q="select * from Masters where deptno="+deptno;
  2. dataset ds=new datset();
  3. sqldataadapter da=new sqldatadapter(q, conn);
  4. da.fill(ds,"fill");
  5. listviewitem list=null;
  6. foreach(datarow dr in ds.tables["fill"].rows)
  7. {
  8. list=new lisviewitem(dr.rows["empno"].tostring());
  9. listview.items.add(list);
  10. list.subitems.add(dr.rows["empname"].tostring())
  11. }
In masters tables row values r ther.
deptno, empno emname
1 100 u
2 200 k
3 null null
4 null op
if i select deptno 1 values r retrived...if i select deptno 3 then tht error exists
Please me how to solve the problem. I think everbody understood
Apr 28 '08 #1
4 1797
Plz reply me Guys i am in very urgent
Apr 29 '08 #2
r035198x
13,262 8TB
Plz reply me Guys i am in very urgent
You posted that in the wrong forum.
This is certainly not a programming challenge.
You get responses faster if you post in the correct forum.
Apr 29 '08 #3
Frinavale
9,735 Expert Mod 8TB
Hi Friends,
There is no row at position 0 Error
here it is my code..
Expand|Select|Wrap|Line Numbers
  1. string q="select * from Masters where deptno="+deptno;
  2. dataset ds=new datset();
  3. sqldataadapter da=new sqldatadapter(q, conn);
  4. da.fill(ds,"fill");
  5. listviewitem list=null;
  6. foreach(datarow dr in ds.tables["fill"].rows)
  7. {
  8. list=new lisviewitem(dr.rows["empno"].tostring());
  9. listview.items.add(list);
  10. list.subitems.add(dr.rows["empname"].tostring())
  11. }
In masters tables row values r ther.
deptno, empno emname
1 100 u
2 200 k
3 null null
4 null op
if i select deptno 1 values r retrived...if i select deptno 3 then tht error exists
Please me how to solve the problem. I think everbody understood
I'm not sure what you are doing in the Selected Index Changed event for your ListView....maybe you're not properly referencing the correct index?

Could you please post your code for this method so that we can better understand your problem. Remember to use [code] tags when posting code.

-Frinny
Apr 29 '08 #4
Hi Uday,

The line
Expand|Select|Wrap|Line Numbers
  1. list=new lisviewitem(dr.rows["empno"].tostring());
  2.  
should be

Expand|Select|Wrap|Line Numbers
  1. list=new lisviewitem(dr["empno"].tostring());
  2.  
<B>The Datarow object doesn't have the rows collection</B>

Hope now it will work.
May 2 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Peter Abel | last post by:
Hi all, I'm working under W2k with Python 2.2.2 (#37, Oct 14 2002, 17:02:34) on win32 I have a file *test_data.txt* with the following content: 0123456789 0123456789 abcdefghi...
1
by: Felix Natter | last post by:
hi, I have a structure like: <topic name="xxx"> <subtopic name="subxxx"> <subsubtopic name="subsubxxx"> </subsubtopic> </subtopic> </topic>
16
by: Konrad Viltersten | last post by:
Suppose you got a really long page and you'd like to enable the user (supposedly, there's only one but if it's not to difficult we could extend that to any number) not to have to scroll to the...
4
by: Guy | last post by:
Hi, I read an XML file to an XMLDocument and iterate through its nodes. How do I get the XPath position (index) of a certain element? For example If I on the second "b" node I want to get "2": ...
6
by: Gérard Talbot | last post by:
Hello fellow stylers, When trying this page http://www.gtalbot.org/BrowserBugsSection/PercentualRelativePositioning.html I get different rendered layouts with IE 6, IE 7 beta 2, Firefox...
3
by: horusprim | last post by:
Is there a CSS absolute positioning rendering bug in FF1.02 and IE 6? I have been experimenting with precision absolute positioning in CSS. The following test content was used in the...
0
by: lucretia | last post by:
Hi, I've created a layout for an Ajax side that is "single paged" in that when the browser is resized, so is the page. The header is locked to the top, the right panel is locked to the right...
2
by: agbee1 | last post by:
Hello: I've finally made the effort to ween myself from overly using tables and use CSS for my positioning. However, I am having a problem with my navigational menu properly aligning in Firefox,...
0
by: crisscross27 | last post by:
Hi, I found a page called "myflashfetish" where you chan choose mp3 players for my space, well the problem is this, I wanted to place 2 or more players in myspace in a particular place, I read...
1
by: spynx | last post by:
import javax.swing.JOptionPane; import java.io.*; import java.util.Arrays; public class election5 { public static void main( String args ) {
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.