D
Danny
Hi Group,
I am working on a simple user administration system based on VB ASP.NET and
an Access database. The database contains the folowing data:
Users:
UserID, f_UserTypeID, Name, Email
1, 1, Pat, (e-mail address removed)
2, 1, Joe, (e-mail address removed)
3, 2, Tim, (e-mail address removed)
UserType:
UserTypeID, UserType
1, Administrator
2, User
As seen here, key "UserTypeID" from table UserType is used as foreign key
"f_UserTypeID" in table Users. Being an administrator it should be possible
to alter the data in table Users. All data are represented using a GridView
and a SqlDataSource with the following SQL statement:
SELECT Users.*, UserType.* FROM (Users INNER JOIN UserType ON
Users.f_UserTypeID = UserType.UserTypeID)
When altering for example Tim's data, it should be possible to choose
whether he should be an Administrator or a User using a dropdown box.
Therefore, in the design, I have changed the column "UserType" to
TemplateField. In TemplateField -> EditItemTemplate I have placed the
dropdown box.
To update Tim's data in the database, I have defined the following SQL
statement
UPDATE [Users] SET [f_UserTypeID] = @UserType, [Name] = @Name, (e-mail address removed)
I am working on a simple user administration system based on VB ASP.NET and
an Access database. The database contains the folowing data:
Users:
UserID, f_UserTypeID, Name, Email
1, 1, Pat, (e-mail address removed)
2, 1, Joe, (e-mail address removed)
3, 2, Tim, (e-mail address removed)
UserType:
UserTypeID, UserType
1, Administrator
2, User
As seen here, key "UserTypeID" from table UserType is used as foreign key
"f_UserTypeID" in table Users. Being an administrator it should be possible
to alter the data in table Users. All data are represented using a GridView
and a SqlDataSource with the following SQL statement:
SELECT Users.*, UserType.* FROM (Users INNER JOIN UserType ON
Users.f_UserTypeID = UserType.UserTypeID)
When altering for example Tim's data, it should be possible to choose
whether he should be an Administrator or a User using a dropdown box.
Therefore, in the design, I have changed the column "UserType" to
TemplateField. In TemplateField -> EditItemTemplate I have placed the
dropdown box.
To update Tim's data in the database, I have defined the following SQL
statement
UPDATE [Users] SET [f_UserTypeID] = @UserType, [Name] = @Name, (e-mail address removed)