i use this code to retrieve my image field from sql server
(my file isn't picture !!!)
***********
Dim MyData() As Byte
MyData = Ds.Tables(mytable).Rows(0).Item(myfield) 'For Example
Dim K As Long
K = UBound(MyData)
Dim fs As New FileStream("c:\mkh.xml", FileMode.OpenOrCreate, FileAccess.Write) 'in this line get error
fs.Write(MyData, 0, K)
fs.Close()
fs = Nothing
Ds = Nothing
************
but it doesn't work and give me this error in ASP.Net(With Vb)
<<Access to the path "C:\mkh.xml" is denied.>
i get this code from microsoft msdn and alot of furoms !!!!
then why doesn't work??If we start with the error you're getting, the reason is simple. The Account which Asp.Net use to perform different actions (it's called '<MACHINENAME>\ASPNET'), is not allowed access to your XML file by your system. Locate 'C:\mkh.xml', right click it, choose Security & Sharing, locate your ASPNET account, and let this account have the rights to 'Read and Run', 'Read' and 'Write'.
Begin there, and come back later when that is solved and you need more help.
No comments:
Post a Comment