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=47576this 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