Click here to Skip to main content
15,887,350 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to Save Audion Files to The SQL SERVER using ASP.NET Pin
just3ala216-Oct-06 20:27
just3ala216-Oct-06 20:27 
GeneralRe: How to Save Audion Files to The SQL SERVER using ASP.NET Pin
Andrei_KS16-Oct-06 21:21
Andrei_KS16-Oct-06 21:21 
Questionhow to bind dropdown listbox with two tables Pin
monuSaini16-Oct-06 19:30
monuSaini16-Oct-06 19:30 
AnswerRe: how to bind dropdown listbox with two tables Pin
shreekar16-Oct-06 19:46
shreekar16-Oct-06 19:46 
GeneralRe: how to bind dropdown listbox with two tables Pin
monuSaini16-Oct-06 20:18
monuSaini16-Oct-06 20:18 
GeneralRe: how to bind dropdown listbox with two tables Pin
shreekar16-Oct-06 20:26
shreekar16-Oct-06 20:26 
GeneralRe: how to bind dropdown listbox with two tables Pin
monuSaini16-Oct-06 21:27
monuSaini16-Oct-06 21:27 
GeneralRe: how to bind dropdown listbox with two tables Pin
shreekar16-Oct-06 21:42
shreekar16-Oct-06 21:42 
Query:

select sectorTable.sectorId Sectorid, sectorName, SubSectorId, subsectorName<br />
from sectorTable, subSectorTable<br />
where sectorTable.sectorId = subSectorTable.sectorId<br />
order by sectorTable.sectorId


Change as per table names and syntax as per database type.

Code for filling drop down:

dim prevsecid as integer = 0<br />
<br />
dr.read (where dr is the datareader object)<br />
prevsecid = dr("Sectorid")<br />
add sector info to drop down (text = sector name, value = sector id)<br />
add sub sector info to drop down (text = sub sector name, value = sub sector id)<br />
<br />
while dr.read<br />
<br />
if prevsecid = dr("Sectorid")<br />
<br />
	add sub sector info to drop down<br />
<br />
else<br />
<br />
	prevsecid = dr("Sectorid")<br />
	add sector info to drop down<br />
	add sub sector info to drop down<br />
<br />
end if<br />
<br />
Loop

You can put the foll code in a function for easy reuse

add sector info to drop down
add sub sector info to drop down
If you want the indentation as shown in your post above, add something like "-->" to the subsector name when adding it to dropdown.

Hope this helps.

Shreekar
http://shreekarishere.blogspot.com

GeneralRe: how to bind dropdown listbox with two tables Pin
monuSaini17-Oct-06 23:35
monuSaini17-Oct-06 23:35 
GeneralRe: how to bind dropdown listbox with two tables Pin
shreekar18-Oct-06 0:07
shreekar18-Oct-06 0:07 
GeneralRe: how to bind dropdown listbox with two tables Pin
monuSaini18-Oct-06 0:40
monuSaini18-Oct-06 0:40 
Questionhistory deletion in vb.net Pin
amaneet16-Oct-06 19:07
amaneet16-Oct-06 19:07 
AnswerRe: history deletion in vb.net Pin
srilu nagalla16-Oct-06 19:12
srilu nagalla16-Oct-06 19:12 
GeneralRe: history deletion in vb.net Pin
amaneet16-Oct-06 19:43
amaneet16-Oct-06 19:43 
GeneralRe: history deletion in vb.net Pin
srilu nagalla16-Oct-06 20:05
srilu nagalla16-Oct-06 20:05 
QuestionProgrammatically Create a DSN Pin
nannapanenikamalnath16-Oct-06 19:06
nannapanenikamalnath16-Oct-06 19:06 
AnswerRe: Programmatically Create a DSN Pin
Andrei_KS16-Oct-06 20:08
Andrei_KS16-Oct-06 20:08 
QuestionHow to compare values Pin
miniThomas16-Oct-06 18:51
miniThomas16-Oct-06 18:51 
AnswerRe: How to compare values Pin
Guffa16-Oct-06 19:04
Guffa16-Oct-06 19:04 
AnswerRe: How to compare values Pin
Faisal Khatri16-Oct-06 19:26
Faisal Khatri16-Oct-06 19:26 
AnswerRe: How to compare values Pin
Faisal Khatri16-Oct-06 19:34
Faisal Khatri16-Oct-06 19:34 
GeneralRe: How to compare values Pin
shreekar16-Oct-06 19:49
shreekar16-Oct-06 19:49 
AnswerRe: How to compare values Pin
Suresh Pirsquare16-Oct-06 20:06
Suresh Pirsquare16-Oct-06 20:06 
GeneralRe: How to compare values Pin
miniThomas16-Oct-06 21:05
miniThomas16-Oct-06 21:05 
QuestionCheck for culture support in ASP.Net 2.0 Pin
dotnetquery16-Oct-06 17:51
dotnetquery16-Oct-06 17:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.