Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

Front Page Drop-down Menu to query Access DB

  Asked By: Lydia    Date: Jan 05    Category: Asp.net    Views: 1735
  

I don't have any programming experience. I have done most of what I
need to do using the "Normal" view in Front Page. I can query my DB
using a text box, but I can't figure out how to do it using a
dropdown menu (so the user doesn't have to know the value exactly as
it appears in the database). Does anyone have time to tell me how to
do this?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Raju Srinivas     Answered On: Jan 05

If Not Page.IsPostBack Then
Dim ConnectionString As String = "Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=ATSCNETSuprt;Data Source=vsdotnet2003;Packet
Size=4096"
Dim CommandText3 As String = "select Distinct StartDate from
WorkLogs Where (NetworkEng = '" & strNetEng & "') ORDER BY StartDate DESC"

Dim myConnection As New SqlConnection(ConnectionString)
Dim myCommand3 As New SqlCommand(CommandText3, myConnection)

DropDownList1.DataTextField = "StartDate"

myConnection.Open()

DropDownList1.DataSource =
myCommand3.ExecuteReader(CommandBehavior.CloseConnection)
DropDownList1.DataBind()
End If

Then:

<!-- <asp:ButtonColumn Text="Delete" CommandName="Delete"
ItemStyle-Font-Size="smaller" ItemStyle-Width="10%"></asp:ButtonColumn> -->
<Font size=+1><B><asp:Label id="netEngLbl"
runat="server"></asp:Label></b></FONT> <asp:Label id="Message1"
ForeColor="red" EnableViewState="false" width="80%" runat="server"></asp:Label>

<hr>
<Span class="DashDateGroup"><font size=+1>Select Date</font>:
<BR></span>
<asp:DropDownList id="DropDownList1" Coluns=15
runat="server"></asp:DropDownList>
 
<asp:Button id="Button1" onclick="ApplyFilter_Click"
runat="server" Text="Show Records"></asp:Button>
<HR>

</Form>

 
Didn't find what you were looking for? Find more on Front Page Drop-down Menu to query Access DB Or get search suggestion and latest updates.




Tagged: