473,387 Members | 1,700 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,387 software developers and data experts.

There is no row at position 0: Selecting value of dropdown list

109 100+
Hi ,

I have two two down list on my .net form.
I am running a query to return a result based on what is selected from drop down list .... but it is not working for me.

I get error message: There is no row at position 0.

I know I have a data in it my database. and i get the result when i put actual value in this query rather than selecing from drop down list.

Here is my query:
Expand|Select|Wrap|Line Numbers
  1.                 Qcheckdata.SelectCommand.CommandText += " AND CRW1_NAME =  '"+ dpcrwlist1.SelectedItem+"%'";                                //Qcheckdata.SelectCommand.CommandText += " AND CRW2_NAME = '"+ dpcrwlist2.SelectedItem+"%'";
  2.  
Please help me.

Thanks,
Oct 16 '07 #1
3 1730
vanc
211 Expert 100+
Hi ,

I have two two down list on my .net form.
I am running a query to return a result based on what is selected from drop down list .... but it is not working for me.

I get error message: There is no row at position 0.

I know I have a data in it my database. and i get the result when i put actual value in this query rather than selecing from drop down list.

Here is my query:
Expand|Select|Wrap|Line Numbers
  1.                 Qcheckdata.SelectCommand.CommandText += " AND CRW1_NAME =  '"+ dpcrwlist1.SelectedItem+"%'";                                //Qcheckdata.SelectCommand.CommandText += " AND CRW2_NAME = '"+ dpcrwlist2.SelectedItem+"%'";
  2.  
Please help me.

Thanks,
I think you need to provide more information about datareader, push in more code, I don't think your command text has any problems. Are they drop down list?
Oct 16 '07 #2
arial
109 100+
yes,

there are drop down list.

Thank You,
Oct 17 '07 #3
Shashi Sadasivan
1,435 Expert 1GB
try debugging your code, and check the final query that is being built after selectng the values from the drop down lists.

and then paste that query string into your query editor in your DB interface and check the same.

cheers
Oct 17 '07 #4

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

Similar topics

2
by: Joachim Bauer | last post by:
I'm using the code below to display a menu that opens when the mouse goes over the main menu item (try it in your browser to understand the behaviour). It uses "position:absolute" and a switch...
1
by: jzhang29 | last post by:
I have a JSP page and it contains a dropdown list called Office. What I try to do is: When I select different office from this list, the information of office (address, phone,etc) will be...
1
by: Kubus | last post by:
Please help, IE 6.0 seems to hava a problem with input form autocomplete dropdown positioning. The dropdown list with last entries which appears normally right below the field but when used within...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: koti | last post by:
hi i have written some code for selecting an item in combobox dropdown list which is in datagrid columm. by scrolling the mouse we select any item from the list. but by pressing the down key...
3
by: KatMagic | last post by:
How do you force a drop down list to default to a particular item based on its value? I have a drop down list with options Yes, No, Maybe, All, and I would like it to default to "All" This is...
5
by: =?Utf-8?B?QnJlbmRlbiBCaXhsZXI=?= | last post by:
Hello. I am reading a value from a table and trying to determine if that value exists in a list of values associated with a dropdownlist. If so, I select the value, otherwise, I don't. I haven't...
2
by: SunnySnow29 | last post by:
Hi, I have a 2 drop down lists in C# populated with data from a SQL 2005 db. When a new item of data is inserted the second list must update to reflect the change (the first drop down list will...
3
by: John | last post by:
I have two dropdown lists that I have bound to a datatable and set the DataTextField and DataValueField for. Both lists show the values I expect from the database. However, when I need to access...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.