473,507 Members | 12,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ddl binding

31 New Member
hi
i am binding values from database to ddl through sqldatareader
records are binding in my dripdownlist but my first record is dosen't bind
i.e if i have 4 records in my table. ddl is binding only three records from 2 to 4 only dosen't bind 1st record.
shall i know what is the problem

please help me...
Aug 8 '08 #1
5 1204
DrBunchman
979 Recognized Expert Contributor
Can you print your code please where you load your data and bind it to the DropDownList.

Are you doing anything like
Expand|Select|Wrap|Line Numbers
  1. If Not DBReader.Read Then
before binding to the DropDownList? Remember that .Read will move the reader on to the nex record.

Dr B
Aug 8 '08 #2
brettokumar
31 New Member
hi
this is my code

Expand|Select|Wrap|Line Numbers
  1. string strpos = "select * from adposition";
  2.             sdr = daClass.getdr(strpos);
  3.  
  4.             if (sdr.Read())
  5.             {
  6.                 ddl_adsposition1.DataSource = sdr;
  7.                 ddl_adsposition1.DataTextField = "ads_posname";
  8.                 ddl_adsposition1.DataValueField = "ads_posid";
  9.                 ddl_adsposition1.DataBind();
  10.             }
  11.             sdr.Close();
Aug 8 '08 #3
DrBunchman
979 Recognized Expert Contributor
Then that's why - remove the
Expand|Select|Wrap|Line Numbers
  1. if (sdr.Read()) 
statement and it will work.
Dr B
Aug 8 '08 #4
brettokumar
31 New Member
thanks man thank u very much
Aug 8 '08 #5
DrBunchman
979 Recognized Expert Contributor
No problem! Glad to help.

Dr B

PS Please remember to wrap your code in CODE tags using the # button - it makes your posts much easier to read. Check the Posting Guidelines for details.
Aug 10 '08 #6

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

Similar topics

0
2319
by: Ann Morris | last post by:
INTRODUCTION One of the most powerful aspects of .NET and Windows Forms is data binding. Data binding is the process of associating user interface (UI) elements with a data source to generate a...
1
7914
by: JD Kronicz | last post by:
Hi .. I have an issue I have been beating my head against the wall on for some time. I am trying to use late binding for MS graph so that my end users don't have to worry about having the right...
9
10392
by: Zlatko Matić | last post by:
I was reading about late binding, but I'm not completely sure what is to be done in order to adjust code to late binding... For example, I'm not sure if this is correct: early binding: Dim ws...
1
2613
by: Bruce | last post by:
Hi, there, I meet a problem about comboBox binding. -------------------- Database: Northwind Tables: 1) Products 2) Categories I create a form (named "form1") to edit the record from...
0
4779
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
30
2786
by: lgbjr | last post by:
hi All, I've decided to use Options Strict ON in one of my apps and now I'm trying to fix a late binding issue. I have 5 integer arrays: dim IA1(500), IA2(500), IA3(500), IA4(500), IA5(500) as...
0
2296
by: Steven Bolard | last post by:
Hello, I am trying to port my .net 1.1 application to 2.0. I am using vs2005. I am trying to get my webservices to run and although i can compile them and and get wsdl and service descriptions...
6
2433
by: Mikus Sleiners | last post by:
Is there any way to enable exception throws in VS 2005, that occur during binding operations? I am upset that i can't see exceptions that are thrown during binding operations. It's very hard to...
15
3085
by: Tom Gur | last post by:
Hi, What is early/late binding ?
3
16043
ADezii
by: ADezii | last post by:
The process of verifying that an Object exists and that a specified Property or Method is valid is called Binding. There are two times when this verification process can take place: during compile...
0
7110
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
7372
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...
1
7030
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
7482
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...
1
5041
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...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.