troubleshooting Question

Vs 2005 data connections assistance needed

Avatar of neoice
neoice asked on
.NET Programming
4 Comments1 Solution198 ViewsLast Modified:

on my web form I have 2 radio buttons, 1 for staff and 1 for student and a dropdown list box (cbintake) for intake (7,8,9,10,11,12,13)

I also have another dropdown list box which will display a staff/student name(cbperson).

I am having trouble achieving exactly what I want.

i have placed an sqldatasource on the form for (cbperson) listbox

<asp:DropDownList ID="CbPerson" runat="server" DataSourceID="Sql1" DataTextField="FULLNAME" DataValueField="FULLNAME" > </asp:DropDownList><asp:SqlDataSource
                  ID="Sql1" runat="server" ConnectionString="<%$ ConnectionStrings:conn1 %>"
                  SelectCommand="SELECT [FULLNAME] FROM [TblStudents] WHERE ([INTAKE] = @INTAKE) ORDER BY [INTAKE]">
                      <asp:ControlParameter ControlID="CbIntake" Name="INTAKE" PropertyName="SelectedValue"
                          Type="String" />

So, if I select 12 from 'cbintake' all year 12 students are displayed in 'cbperson' - cool!

However, now the plot thickens and I am beginning to think I need to put the above string in VB code to achieve what I want.

Here is what I want...

When the student raido button is selected I want to achieve the above.

When the staff radio button is selected I want to disable 'cbintake' (i have sorted that part) and run a different a different query to populate 'CBperson', for example: SELECT [FULLNAME] FROM [TblStaff]

webconfig connection string

            <add name="conn1" connectionString="Data Source=ARAGORN;Initial Catalog=db1SQL;Integrated Security=True" providerName="System.Data.SqlClient"/>

I hope this makes sense :O)

Thanks in advance

Jorge Paulino
IT Pro/Developer
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros