none
Reading and Saving data from an access database in a Web Application. RRS feed

  • Question

  • Hi all. This is a rather specific quesiton, but I will try to make it clear as possible.

     

    Notes:

    IDE:  Visual Studio 2005

    Code Language: VB.net

    Application Type: Web Applicaiton

    Database: Access 2003

    ------------------------------------------

    Ok. I am creating a web app that will be used by teachers to submit reports of their students.  Thus I have created an access database with 3 tables.

     

    Tables  -- Columns

    Teachers - TeacherID, First Name, Last Name, Username, Password,

    Students - TeacherID, StudentID, First Name, Last Name

    Reports -  (not important)

     

    The teachers must first login before they can reach the report page. For the login page I used the login control provided by Visual studio. The login control uses the "Teachers" table in the access database as a membership provider.

     

    Once a teacher is validated they will be sent to the report page. On the report page I want to fill a combo box with the First and Last names of all students in the "students" table who have the same teacherID as the loged in teacher.

     

    I'm stuck at the last part. If this was a windows application it would be simple, but I'm very new to web applications and  know next to nothing about asp.net.

     

    Question 1: How could I find the teacherID of the logged in user and save it to a variable.

     

    Question 2: How could I then fill the combo box with the first +last names of all students with the same TeacherID as the one in the variable. (I'll need to make a query, but I don't know the syntax etc. for filling a web based combo box)

     

    Hope that makes sense.

    If someone could just point me to a source of documentation that would explain this that would be fine, but examples would also be helpful.

     

    Thanks

     

     

     

     

     

     

    Wednesday, August 22, 2007 6:41 PM

All replies

  • As these are very common questions in ASP.NET you should ask these in an ASP.NET forum rather than a SQL Server forum (as you are in addition using Access as a datastore). For getting your feet wet, the things to look at would be "sotring data in viewstate" and "Using parametrized queries"

    Jens K. Suessmeyer

    ---
    http://www.sqlserver2005.de
    ---

     

    Wednesday, August 22, 2007 8:21 PM