Welcome to Dream.In.Code
Become an Expert!

Join 150,413 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 994 people online right now. Registration is fast and FREE... Join Now!




how to create a search option in asp.net using vb as language

 
Reply to this topicStart new topic

how to create a search option in asp.net using vb as language, how to narrow down my search.... subject>networks>network prog..

rahul 865
28 Mar, 2008 - 10:31 PM
Post #1

New D.I.C Head
*

Joined: 28 Mar, 2008
Posts: 2

plz help me....

i want search option like shown on the site below :

http://www2.lib.ncsu.edu/catalog
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: How To Create A Search Option In Asp.net Using Vb As Language
28 Mar, 2008 - 10:34 PM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: code.gif

Thanks smile.gif
User is offlineProfile CardPM
+Quote Post

rahul 865
RE: How To Create A Search Option In Asp.net Using Vb As Language
29 Mar, 2008 - 10:25 PM
Post #3

New D.I.C Head
*

Joined: 28 Mar, 2008
Posts: 2

hey i am a beginner only ... i have shown search result using datagrid ...
but i have problem with narrow down this search.....


CODE
   Imports System.Data.OracleClient
Public Class WebForm1
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.con = New System.Data.OracleClient.OracleConnection
        '
        'con
        '
        Me.con.ConnectionString = "user id=scott;password=tiger"

    End Sub
    Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
    Protected WithEvents Button1 As System.Web.UI.WebControls.Button
    Protected WithEvents con As System.Data.OracleClient.OracleConnection
    Protected WithEvents dd_list As System.Web.UI.WebControls.DropDownList
    Protected WithEvents Label2 As System.Web.UI.WebControls.Label
    Protected WithEvents lbl0 As System.Web.UI.WebControls.Label
    Protected WithEvents dg As System.Web.UI.WebControls.DataGrid
    Protected WithEvents lb1 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents lb2 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton26 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton25 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton24 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton23 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton22 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton21 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton20 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton19 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton18 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton17 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton16 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton15 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton14 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton13 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton12 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton11 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton10 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton9 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton8 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton7 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton6 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton5 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton4 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton3 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents LinkButton2 As System.Web.UI.WebControls.LinkButton
    Protected WithEvents Label1 As System.Web.UI.WebControls.Label
    Protected WithEvents LinkButton1 As System.Web.UI.WebControls.LinkButton

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region
    Dim query As String

    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
        query = "select * from alum where " & dd_list.SelectedValue & "='" & TextBox1.Text & "'"
        binddata()

    End Sub

    Private Sub OracleConnection1_InfoMessage(ByVal sender As System.Object, ByVal e As System.Data.OracleClient.OracleInfoMessageEventArgs) Handles con.InfoMessage

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim cmd As New OracleCommand
        cmd.Connection = con
        cmd.CommandType = CommandType.Text
        Dim query As String
        Dim res As String
        query = "select count(*) from alum where " & dd_list.SelectedValue & "='" & TextBox1.Text & "'"
        cmd.CommandText = query
        con.Open()
        res = cmd.ExecuteScalar
        con.Close()
        lbl0.Text = res



      


    End Sub
    Public Sub binddata()
        'Put user code to initialize the page here
        'Put user code to initialize the page here
        'Response.Write(strsql)
        Dim da_alum = New OracleDataAdapter(query, con)

        '3. Create a dataset and read values into it using .FILL method
        Dim ds_alum As New DataSet
        da_alum.fill(ds_alum, "details")

        '4. Set the datagrid's datasource to the datareader and databind
        dg.DataSource = ds_alum.Tables("details")

        '5. Databind your control
        Page.DataBind()
    End Sub
    Private Sub dd_list_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dd_list.SelectedIndexChanged

    End Sub

    Private Sub dg_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dg.SelectedIndexChanged

    End Sub

    Private Sub lb1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lb1.Click
        query = "select * from alum "
        binddata()
  


hey one thing more.......
your web addressbar...
http://www.dreamincode.net/forums/index.ph...=30&t=47576
this you have done in php...

i want to know.... how you do this thing below in asp.net :
?act=post&do=reply_post&f=30&t=47576


your help in this regard will be appreciated...
thanks
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 07:51PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month