so, how to show details of that particular person of that row which is in another gridview of another page
i have added this link button to page person
and on another page persondetails i have taken a gridview and in sqldatasource provided querystring ID.
so what should i do next so that that i can get that detail of person on clicking linkbutton of gridview.
plzz help
vikas vanviPosted Nov 24, 2013, 8:48 AM
vikas vanviPosted Nov 24, 2013, 8:30 AM
Satyapriya NayakPosted Nov 24, 2013, 7:12 AM
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test3.aspx.vb" Inherits="test3" %>
test3.aspx.vb code
Imports System.Data
Imports System.Data.SqlClient
Partial Class test3
Inherits System.Web.UI.Page
Dim strConnString As String = System.Configuration.ConfigurationManager.ConnectionStrings.Item("ConnectionString").ToString()
Dim con As New SqlConnection(strConnString)
Dim str As String
Dim com As SqlCommand
Dim sqlda As SqlDataAdapter
Dim ds As DataSet
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
bind()
End Sub
Sub bind()
con.Open()
str = "select * from employee"
com = New SqlCommand(str, con)
Dim reader As SqlDataReader
reader = com.ExecuteReader()
g4.DataSource = reader
g4.DataBind()
con.Close()
End Sub
End Class
test4.aspx code
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test4.aspx.vb" Inherits="test4" %>
test4.aspx.vb code
Imports System.Data
Imports System.Data.SqlClient
Partial Class test4
Inherits System.Web.UI.Page
Dim strConnString As String = System.Configuration.ConfigurationManager.ConnectionStrings.Item("ConnectionString").ToString()
Dim con As New SqlConnection(strConnString)
Dim str As String
Dim com As SqlCommand
Dim sqlda As SqlDataAdapter
Dim ds As DataSet
Dim s1 As String
Dim dt As DataTable
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
con.Open()
s1 = Request.QueryString(0)
str = "select * from employee where empid='" + s1 + "'"
com = New SqlCommand(str, con)
g5.DataSource = com.ExecuteReader
g5.DataBind()
Catch ex As Exception
MsgBox(ex.Message)
End Try
con.Close()
End Sub
End Class