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

how to narrow down my search.... subject>networks>network prog..

Page 1 of 1

2 Replies - 3357 Views - Last Post: 29 March 2008 - 11:25 PM Rate Topic: -----

#1 rahul 865  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-March 08

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

Posted 28 March 2008 - 11:31 PM

plz help me....

i want search option like shown on the site below :

http://www2.lib.ncsu.edu/catalog
Is This A Good Question/Topic? 0
  • +

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

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

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

Posted 28 March 2008 - 11:34 PM

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:

Thanks :)
Was This Post Helpful? 0
  • +
  • -

#3 rahul 865  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-March 08

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

Posted 29 March 2008 - 11:25 PM

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


   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.dreaminco...h...=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
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1