473,396 Members | 2,023 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,396 software developers and data experts.

doubts in dropdownlistboxex in asp.net

hi,
iam using asp.net 2003,In that i had use a droplistbox to bind the datas in page_load events as follows

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
myconnection = New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0; " & _
"Data Source=C:\Inetpub\wwwroot\upload\mydatabase.mdb")
myda = New OleDbDataAdapter("Select * from t_table ", myconnection)
ds = New DataSet()
myda.Fill(ds, "AllTables")
DropDownList1.DataSource = ds
DropDownList1.DataSource = ds.Tables(0)
DropDownList1.DataTextField = ds.Tables(0).Columns("imagepath").ColumnName.ToStr ing()
DropDownList1.DataValueField = ds.Tables(0).Columns("name").ColumnName.ToString()
DropDownList1.DataBind()


End Sub

Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
Label1.Text = DropDownList1.SelectedItem.Value.ToString
End Sub

And setting autopostback property for dropdonlistbox =true.

after running this webpage when selecting any values in dropdownlistbox its first field values were displaying in label1 ,b'coz of writing code in page_load events. what to do for this.....
Mar 27 '07 #1
1 832
kenobewan
4,871 Expert 4TB
Welcome to the site. Try using not page.ispostback in the code.
Mar 27 '07 #2

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

Similar topics

0
by: abbas reji | last post by:
--0-599929911-1059996886=:4358 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Id: Content-Disposition: inline ...
1
by: Piotre Ugrumov | last post by:
I have some problems and some doubts. I have implemented a class hierachy. The base class Velivolo, from Velivolo derive Militare and Civile, from militare derive Aereo and Elicottero, from Civile...
6
by: ritesh | last post by:
Hi, I have been reading some text on C and C++ (i.e advanced books). One of the books mentioned that C++ requires a runtime support whereas C does not - what the author was trying to say was...
17
by: ranjeet.gupta | last post by:
Dear All Below are the few doubts which I got while studying about C 1. Is there any method in C by which we can process the entire string in one unit, 2. Does there exist any way to...
13
by: maadhuu | last post by:
hello everybody, i have 2 doubts . 1. is this always defined ?? int i =10; int a = i++ + i++; and also, i tried this in gcc, answer was 20, so what the sequence points for evaluation of...
6
by: Chua Wen Ching | last post by:
Hi there, I have some questions to ask... just say i have this xml file: Scenario :- Script.xml ======== <software> <settings>
2
by: VMI | last post by:
I'm having doubts as to how the compiler interprets this If statement: bool bIsTrue = true; if (! bIsTrue) { //RUN PROCESS } Here, will "RUN PROCESS" be executed? Or is this just wrong?...
1
by: Chris Leffer | last post by:
Hi. Reading some Microsoft materials about asp.net I came into two doubts. The following sentence is found on the topic "Application State" in the NET Framework documentation: "Calling Lock...
4
by: project | last post by:
Anybody can solve following doubts? 1. Normalization rules. 2. Garbage Collection 3.LinkList Posted Via Usenet.com Premium Usenet Newsgroup Services...
1
by: NagaKiran | last post by:
Hi I want to post VBA related doubts. Where can I post my doubts in VBA? thanks bye
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.