I would like to ask your opinions on how the current log in user can view the data that he/her entered. For example, I am building expenses tracking system. Users can insert all the expenses spent by them by select the month ( drop down menu) which I already made and the expenses by insert them in each text boxes. After they’ve confirmed the items, the system will submit all the data in the database (sql).
How can I retrieve only the row that related to the current username to be shown in gridview of something else> I am working with ASP.NET in C# language.
First this is a great tutorial on how SQL and asp.net works together. It explains how to get data from a database and how to update that same data.
http://www.dotnetperls.com/sqlparameter
in the first example the sql statment says
Your sqlstatment will say
HttpContext.Current.User.Identity.Name;
on this line replace this
with this
command.Parameters.Add(new SqlParameter(“UserName”, HttpContext.Current.User.Identity.Name));
Similar to the example above as well. If you need more direction please let me know.
Hope that helps!