hiiii..i am using asp.net 2005 in VB language and sqlserver 2005..in my form i am using 2 dropdownlist boxes..if i select a name in the dropdown list box1 then the corresponding last name is selected in the dropdwon listbox2...till now everything is working fine,,,now if i want to change the lastname(tht means select different surname for tht name)and press update button it doesnot get updated....,,,,how do i achieve ths,,,
in short i want to update dropdown list box 2 with the new selected item for the corresponding name in dropdown listbox1..
pls help,,,reply asap,,
thnks in advance
johnny.g
0
Junior Poster in Training
Recommended Answers
Jump to PostCan you tell me how you are trying to approach this in the first place before I suggest anything ?
Jump to PostMsgBox(str10)
cmd = New SqlCommand(str10, conn)
Tryda = cmd.ExecuteReader
Just curious..
Why are you calling an ExecuteReader with an update query?
Shouldn't you be using an ExecuteNonQuery instead?
Jump to PostSorry didn't get you.
But let me clarify myself.When you use a command object to update or insert in a database, you need to use an Executenonquery.
Maybe this is giving the problem.
So try
da = cmd.ExecuteNonQuery
in the end where you are trying to …
All 11 Replies
johnny.g
0
Junior Poster in Training
bala24
5
Junior Poster
johnny.g
0
Junior Poster in Training
johnny.g
0
Junior Poster in Training
bala24
5
Junior Poster
johnny.g
0
Junior Poster in Training
bala24
5
Junior Poster
johnny.g
0
Junior Poster in Training
bala24
5
Junior Poster
johnny.g
0
Junior Poster in Training
bala24
5
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.