Wrox Programmer Forums
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 March 20th, 2007, 03:32 AM
Registered User
Join Date: Mar 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Custom datadisplay per user

I'm not sure where to post my question, i think it should be posted here.
 In Visual Webdeveloper, ive made a webapplication for displaying orders from an access database and ive replaced the original SQL server with an Access database, since our company had another SQL server. Ive done this according to Imars excellent article (http://www.spaanjaars.com/QuickDocId.aspx?quickdoc=404). Plus I got another Access database from which orders can be made. I can update orders (using the gridview + update statement).
I can retrieve wich user is logged in
code: Protected Sub Page_Load(ByVal sender As Object, _
         ByVal e As System.EventArgs) Handles Me.Load

        Dim result As String = _
                "Hello {0}. Member of Admin role: {1}"

        Label1.Text = String.Format(result, _
                User.Identity.Name, User.IsInRole("Administrators"))
    End Sub

Everything is working as it should be, but my question is: We dont want company A to see what orders company B has made. I've tried to add an SQL query to the datasource (e.g. select company where session = ??). I really dont have a clue where to start and all my searches on Google, forums came out empty. Ive started .NET web development 3 weeks ago.
Programs used:
- Visual Web Developer Express
- Visual C# Express
- Microsoft Access (2 databases, 1 holding user information, 1 holding the orders)

I apologize if I made a doublepost.
Old March 21st, 2007, 02:58 AM
Registered User
Join Date: Mar 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

no one knows or at least knows where i made a mistake? Or did i post my question in the wrong forum?

Old March 21st, 2007, 07:17 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi

well.. you are in the right forum.. but I think you are asking for an architectural problem rather than a programming one...

Since you have 2 companies and already know who is loggin in, the easy thing to do is add a column to the orders tables that handles the company info and add this column to every sql you do to that table...

this may be not the best solution.. but at least is an easy one...



================================================== =========
Read this if you want to know how to get a correct reply for your question:
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
================================================== =========
Old March 23rd, 2007, 04:23 AM
Registered User
Join Date: Mar 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

I've tried that before, i could see what user is logged in.
As you can see in my first post, i configured a label for holding and retrieving the user info. But with a sql directly pointing to that label, it didnt seem to work.
I just found out there was a [space] which didnt suppose to be there. Removing the space and my personilized page works!
Thanx to gbianchi for replying :)


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom Property Enable & Disable in user control tiks C# 1 August 20th, 2008 09:31 AM
Custom User Control hossrad C# 2005 0 May 10th, 2008 07:40 AM
First Post! adding an icon to a custom user form Banquo_ws Excel VBA 2 March 6th, 2007 04:36 AM
Help! Custom Server Control using User Control diehard ASP.NET 1.0 and 1.1 Professional 2 January 4th, 2006 12:33 PM
User Control within Custom Server Controls www2004 ASP.NET 1.x and 2.0 Application Design 3 April 15th, 2005 09:00 AM

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