|
Hi,
As far as I remember about Windows internal security, every process is running under an account. This account has to be authenticated in the system of course. This is same in case of ISS. There is the process running under ASP.NET user and if you want to manage some files in this process, the ASP.NET user has to have permission for it. This is usual scenario. But........... there is always option to do the impersonation and switch the current process to another context (user).... but that is long story.
In case of web hosting you have to ask admin to set up the ACL. However, nowadays people managing web hosting know, you will need "write" access to App_Data folder, thus it is usually set up in this way.
For example, how do I ensure my program can update my database, but others can't?
This is another thing. Using database login is the right way.
modified on Friday, November 27, 2009 4:58 AM
|
|
|
|
|
Hi, I am having some trouble with creating a simple function that converts a column of a datatable to an array (containing all numbers). Upon running it, it says "Index was outside the bounds of the array"; however, I couldn't understand why my function would create this problem.
Also since I do not usually program using VB.Net, I am not sure if my function has other errors (like syntax errors). Could you please help me check it out? I'd greatly appreciate it! Thanks in advance.
Here's my VB function:
Public Function DatatableToArray(ByVal dt As DataTable, ByVal intColomn As Integer) As Double()<br />
Dim intRows As Integer = dt.Rows.Count<br />
Dim arrValues() As Double = New Double(){}<br />
Dim i2 As Integer<br />
For i2 = 0 To intRows - 1<br />
arrValues(i2) = dt.Rows(i2).Item(intColomn)<br />
Next<br />
Return arrValues<br />
End Function
|
|
|
|
|
Check the value in intColumn variable.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
I'm not really confirm with the VB-Syntax but
arrValues(i2) = dt.Rows(i2).Item(intColomn)
looks like you try to access an double array that is not initialized (or doesn't have enough space).
Look at you definition:
Dim arrValues() As Double = New Double(){} <- maybe here you should say that this array should have
dt.Rows.Count elements
Greetings
Covean
|
|
|
|
|
Declare arrValues with a specific size.
Like this
Dim arrValues() As Double = New Double(dt.Rows.Count - 1) {}
|
|
|
|
|
First of all why dont you use List .... as your collection. It is always better to use ArrayList or Generic List as collection rather than going for Array.
Next, I always prefer to use ForEach rather than For when I am looping through an Enumerable .
If I was in your situation I would write this as :
Private Function DataTableToArray(ByVal x As DataTable, ByVal intCol As Integer) As List(Of Double)
Dim lst As New List(Of Double)
For Each dr As DataRow In x.Rows
lst.Add(dr.Item(intCol))
Next
Return lst
End Function
Or if you still want to use Array you might use List(Of Double).ToArray as well.
Cheers.
|
|
|
|
|
Thanks a lot guys. As soon as I'm home I'll give all of these options a try.
|
|
|
|
|
Hi, try the following code:
Dim arrValues(0 To intRows - 1) As Double
instead of
Dim arrValues() As Double = New Double(){}
modified 27-May-14 5:11am.
|
|
|
|
|
Thank you guys, my problem is solved!
Greatly appreciate it.
|
|
|
|
|
Dear friends.
when size of content of my page is changed(like loading texts from database) , footer is go down and displayed correctly:
http://www.mahdighiasi.net/default.aspx
but when size of sidebar (left pane) of my page is changed (and content is smaller than sidebar), footer don't move and my sidebar image and texts go out from they DIV and include in footer (see left pane):
http://www.mahdighiasi.net/login.aspx
does anyone has any idea for my problem?
Regards.
M. Ghiasi
|
|
|
|
|
the problem is in mozilla. In IE 7 it works fine.. (though strange thing is it has scrollbar in the left )
Actually div will not automatically resize in case of Firefox if the content increases. thus the content goes outside the container.
Add the clear div in the parent div, this makes the parent div to auto adjust its height.
<br />
<div style="clear: both;"> </div>
Cheers.
|
|
|
|
|
Dear Friend!
My Problem was in Mozilla, Chrome and IE8. in IE7 and IE8 Compatibility mode i haven't problems.
i added
<div style="clear: both;"> </div> to the end of my parent div, it works correctly!
Thanks for your solution.
Cheers.
M. Ghiasi
|
|
|
|
|
You are most welcome bro...
|
|
|
|
|
Hi all, I'm publishing a small site developed in ASP.NET where I retrieve the user name with the foillowing command Server.HtmlDecode(User.Identity.Name). On debuf mode is working fine, but as soon as I publish it (IIS v6.0) that value is empty.
Can someone help me to setup properly the IIS?
Many thanks
Ralph
|
|
|
|
|
Which authentication mode are you are using in IIS ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Thanks for your quick response.
I'm using Annonimous authentication
|
|
|
|
|
rljurado wrote: I'm using Annonimous authentication
You need to select Windows Authentication Mode.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Why this message down voted ? I guess the person who asked the question voted 5 a few hours back. But now some one down voted it, What is the reason behind it ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I think some people envy your lovely work you are doing in this forum. Ignore it... I upvoted you buddy...
|
|
|
|
|
I know this type of guys who don't know how to help and dont encourage..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Thts Not hte Answer Abhi is Looking For?
R u using Windows or forms or passport?
rljurado wrote: I'm using Annonimous authentication
If You are going for anonymous access .If it is forms authentication the name will be empty my friend..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
sashidhar wrote: Thts Not hte Answer Abhi is Looking For?
I was looking for that only . I just wanted to know which Authentication he has used on IIS.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
modified on Thursday, November 26, 2009 10:19 AM
|
|
|
|
|
Lol I am Wrong..!
I thought he is Asking for Authentication in asp.net..!
I came to Know Now he is asking in IIS..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Thank you both, but I might be missing something and I don't know what I am doing wrong.
On my web.config I am using <authentication mode="Windows">
On the IIS Authentication there are 3 options
- Annonimous (this is the one enabled so far)
- Forms
- ASP.NET
What should I do?
|
|
|
|
|
rljurado wrote: On my web.config I am using
What you are using over web.config. I guess some text is missing over there.
rljurado wrote: On the IIS Authentication there are 3 options
- Annonimous (this is the one enabled so far)
- Forms
- ASP.NET
In IIS there should have Windows Authentication. You need to select it.
For learning more about IIS, please read this article:
Beginner's Guide : Exploring IIS 6.0 With ASP.NET [^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|