Storing Logged in Username in table of asp.net
I'm developing a Customer online ordering system using asp.net.
I created two tables Users & Orders.
1. User table consists of the columns (UserId, Username, Password etc.)
2. Order Table COnsists of the columns (OrderId, Order name,UserId)
I link two tables the User Table and order Table by specifying UserId in the User table as Primary key and foreign key as UserId in Order table.
Once a normal User looged in to the system, he should be able to create his orders.
Once he create order, his logged in Username should be stored in the Order table for reporting purpose.
How can i make this?
Please guide me on this.
assuming OrderId is an identity field...
User Name entry
when, first time user logged into the page,after enter his credentials,in submit button click event capture the user Id, then send it to the table, get the name of the user then insert into order tble .
insert into tblOrder ([OrderName], [UserId],[username])
values ('someName', 001,(User Name)).
string UserId = System.Guid.NewGuid().ToString();
string OrderId= System.Guid.NewGuid().ToString();
insert into TableUser((UserId, Username, Password etc.)
insert into TableOrder(OrderId, Order name,UserId)
|All times are GMT +1. The time now is 12:02 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.