Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I use asp.net, c# and mysql.
So how can I insert selected image from gridview to mysql table? Please show me some examples.
Posted
Comments
[no name] 22-Sep-15 2:36am    
You can attach a method which will do a DB call to the MySql and save the image to the database using the DB connection on the selectedIndex change method of the GridView.

1 solution

foreach (GridViewRow row in gv.Rows)
{
 CheckBox chkBox = row.FindControl("chkSelected") as CheckBox;
 if(chkBox.Checked = true)
  {
   Image img = (Image)row.Cells[1].Controls[1];
   string url = img.ImageUrl;
  }
}


This is how you can get the selected images.
 
Share this answer
 

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