我如何从Access数据库表中获取路径 [英] how can i get path from access db table
问题描述
大家好,
我有一个包含两个字段的表,它们是图像的名称和路径.
当我尝试通过
从数据库中检索路径时
Hi all,
I have a table with two fields, they are name and path of image.
While I am trying to retrieve the path from database through
oledbdatareader omgbtn.ImageUrl=dr[1].tostring();
我收到类似
的错误
索引在数组的边界之外"
另一个问题是:如何保存对imageButton所做的更改?
是什么意思,当我下次打开网站时,过去设置的图像没有出现吗?
那么如何将对页面的更改保存到生命周期?
请请一个人帮我
提前非常感谢
I get an error like
"Index was outside bounds of an array"
Another problem is: How can I save changes made to imageButton?
Meaning when I open website next time the image which I set past time is not appearing?
So how can I save changes to the page to lifetime?
please please some one help me
thanks a lot in advance
推荐答案
拉姆,
尝试使用如下代码:
Hi Ram,
Try to use code like this:
oledbdatareader omgbtn.ImageUrl=dr["path of the image"].tostring();
"path of the image"
是您要在其中保存图像路径的数据库的列名称.
如果您能向我提供完整的代码,以便对您的第二个查询提供一些建议,那就太好了.
问候,
瓦姆西·阿尼尔(Vamsi Anil)
This "path of the image"
is the column name of your database where you are saving the image''s path.
It would be nice if you can provide me the full code so that I can give you some suggestions about your second query..
Regards,
Vamsi Anil
您是否编写了删除图片的代码?如果是,那么您必须删除该图像.
或者在调试时检查图像的路径,将其复制并粘贴到Windows资源管理器中,看看是否将其定向到图像.
让我知道发生了什么事.
如果您还可以给我路径,包括原始路径和调试时获得的路径,那将是很好的..
问候,
瓦姆西(Vamsi)
Hi,
Have you written any code for deleting the image? If yes, then you must be deleting the image.
Or just check with the path of the image while debugging, copy that and paste it in windows explorer and see whether you are directing it to the image or not.
Let me know whatz happening.
It would be nice if you can give me the paths also, both original path and the one you are getting while debugging..
Regards,
Vamsi
这篇关于我如何从Access数据库表中获取路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!