请问 各位大xia:怎么用foreach 循环的把多张图片路径存进数据库对应的多个字段,QQ在线等待 867116158.谢 80
protectedvoidup4_Click1(objectsender,EventArgse){foreach(Controlclinmytable.Controls)...
protected void up4_Click1(object sender, EventArgs e)
{
foreach (Control cl in mytable.Controls)
{
if (cl is FileUpload)
{
FileUpload fi = cl as FileUpload;
string myfile = fi.PostedFile.FileName;
string severpath = Server.MapPath("Image");
string sumpath = severpath + @"\" + myfile;
fi.SaveAs(severpath + @"\" + myfile);
// 调用Insert 方法插入数据 就是这里应该怎么实现
// 怎么对应数据库对应的多个字段(p1,p2,p3,p4)?
}
}
Response.Write("OK");
详细请QQ联系 展开
{
foreach (Control cl in mytable.Controls)
{
if (cl is FileUpload)
{
FileUpload fi = cl as FileUpload;
string myfile = fi.PostedFile.FileName;
string severpath = Server.MapPath("Image");
string sumpath = severpath + @"\" + myfile;
fi.SaveAs(severpath + @"\" + myfile);
// 调用Insert 方法插入数据 就是这里应该怎么实现
// 怎么对应数据库对应的多个字段(p1,p2,p3,p4)?
}
}
Response.Write("OK");
详细请QQ联系 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询