Click here to Skip to main content
15,568,965 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I need help. Yes, like seriously. I have been implement this so called system like a month. So far, everything is just nice but when it comes to database thingy I got STUCK! Ok, i have 8 textboxes which allow user to enter data. I declare each of the textbox as a column name so after user key in their data, all the value of the textbox will be kept in row respectively according to their column name. That part is done. The problem now, how can i retrieve back all the data that only related to user, lets say User A want to view only her/his data that need to be shown in gridview. Thank you. My table got username column too.

private string months;
private string expen1;
private string price1;
private string expen2;
private string price2;
private string expen3;
private string price3;
private string expen4;
private string price4;
private string expen5;
private string price5;
private string expen6;
private string price6;
private string expen7;
private string price7;
private string expen8;
private string price8;

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGridview();
}
}
protected void BindGridview()
{
gvDetails.DataSource = (i dont know what to put here)
gvDetails.DataBind();
}
protected void gvDetails_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
gvDetails.EditIndex = -1;
BindGridview();
}
protected void gvDetails_RowEditing(object sender, GridViewEditEventArgs e)
{
gvDetails.EditIndex = e.NewEditIndex;
BindGridview();
}
protected void gvDetails_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
//* i dont know this part too (delete section)
}
protected void gvDetails_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
//* this is for update thingy. Stuck too
gvDetails.EditIndex = -1;
BindGridview();
}
Posted
Comments
Varun Sareen 21-Feb-12 22:53pm    
What is database thingy? you need to have a database (back end) connectivity in order to store and retrieve the data according to the filter you require..in your case it is username.

The database could be MS Sql Server Or MS Access Or Oracle

1 solution

 
Share this answer
 
Comments
Sam Path 21-Feb-12 23:13pm    
Nice Collection :)
Varun Sareen 21-Feb-12 23:14pm    
thanks
Sarvesh Kumar Gupta 22-Feb-12 0:32am    
My 5, for your Hard Work and giving useful info.
Varun Sareen 23-Feb-12 11:56am    
thanks sarvesh jee
unknown224 22-Feb-12 1:29am    
I cant find any of ur links related to what im looking for. :(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900