Click here to Skip to main content
15,917,177 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i create a form,after filling the form,the form details can be directly save into gridview .Then after again submit the form details then before details can be deleted.so please help me
i have written code as below
NAME:
ADDRESS:
CITY:
STATE:
CONTACT NO:
EMAIL:
COMMENTS:
RESUME:

file upload control been here

C#
if (FileUpload1.HasFile)
{
    FileUpload1.PostedFile.SaveAs(Server.MapPath("~/data/") + FileUpload1.FileName);
}
DataTable dt = new DataTable();

    dt.Columns.Add("resume", typeof(string));
    dt.Columns.Add("name", typeof(string));
    dt.Columns.Add("address", typeof(string));
    dt.Columns.Add("city", typeof(string));
    dt.Columns.Add("state", typeof(string));
    dt.Columns.Add("contactno", typeof(string));
    dt.Columns.Add("email", typeof(string));
    dt.Columns.Add("comment", typeof(string));
    //foreach (string strfile in Directory.GetFiles(Server.MapPath("~/data")))
    //{
    //    FileInfo fi = new FileInfo(strfile);

    dt.Rows.Add(FileUpload1.FileName, TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, TextBox6.Text, TextBox7.Text);


//}
GridView1.DataSource = dt;

GridView1.DataBind();
Posted
Updated 15-Sep-13 20:27pm
v3
Comments
syed shanu 15-Sep-13 21:51pm    
You need to improve your question,its not clear to understand ,what this mean "But my problem is again i fill the form previous row can be deleted then no new row can,t be created.so please help me"
syed shanu 16-Sep-13 2:35am    
You have a form and user fills and click save button .the details will be saved to your grid.if user enter the same information again ,do you want to update in same record ,is this do you need.
naveen guntaka 19-Sep-13 3:36am    
no,i want the information store in the other row
Leena 206 16-Sep-13 4:46am    
Not getting your problem.. improve your question

As per my understanding, what u can do is - After Login, check for email id in your database..(hope it is a unique field) .. If u find that, delete content regarding those Id.
 
Share this answer
 
 
Share this answer
 
Please clear your question not able to get the problem.
 
Share this answer
 
Comments
Maciej Los 16-Sep-13 5:43am    
This is not an answer. Please, delete it to avoid wodn-voting. To post comment, use "Have a question or comment" widget.

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