Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9
This is the forum to discuss the Wrox book Professional ASP.NET 2.0 Special Edition by Bill Evjen, Scott Hanselman, Devin Rader, Farhan Muhammad, Srinivasa Sivakumar; ISBN: 9780470041789
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 16th, 2006, 01:35 PM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default show data for a specific user

hello i'm using asp.net 2 with VB, i have a little problem i have a users table and a marks table for students now each parent in the users table has a child and he wants to see his child's marks in the subjects his child take, i'm using the aspnetdb and its users table i have that code but it's not working :
Code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        If Page.IsPostBack = False Then
            binddata()
        End If

    End Sub

    Sub binddata()
        Dim myuser As String = Context.User.Identity.Name
        Dim con As String = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\aspnetdb.mdf;Integrated Security=True;User Instance=True"
        Dim sq As String = "SELECT dbo.grades.serial, dbo.grades.stage, dbo.grades.class, dbo.grades.subject, dbo.grades.marks FROM dbo.grades INNER JOIN dbo.aspnet_Users ON dbo.grades.serial = dbo.aspnet_Users.serial WHERE dbo.aspnet_Users.serial = " & myuser
        Dim conn As SqlConnection = New SqlConnection(con)
        Dim com As SqlCommand = New SqlCommand(sq, conn)
        Try
            conn.Open()
            Dim rdr As SqlDataReader = com.ExecuteReader()
            Me.dl1.DataSource = rdr
            Me.dl1.DataBind()
        Catch ex As Exception
            Response.Write("error in yor query")
            conn.Close()

        End Try

    End Sub
so hope u guys can help me in this problem.thanks in advance

 
Old July 17th, 2006, 09:08 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 Catch ex As Exception
            Response.Write("<p>error in yor query<p>")
            conn.Close()

Did you try that?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Search specific data from specific columns yogeshyl SQL Language 1 January 16th, 2008 11:12 AM
Copy specific data in specific cells of sheet2 yogeshyl Excel VBA 1 May 14th, 2007 07:40 AM
how to show user interface data in crystal report sanjay_jadam Crystal Reports 1 May 26th, 2005 02:25 AM
View recordset for the specific user mikersantiago Classic ASP Basics 4 October 20th, 2004 10:19 AM
How to show specific tables jackps SQL Server 2000 1 January 14th, 2004 10:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.