|
Good Day Maxdd 7
as the guys says , that is how identity works. Delete and Truncate Works Differently. The Delete will continue from the previous seed but Truncate will start from the beginning. lets say i have this
Table1
<pre>
=============
ID | Name
=============
1 | Vuyiswa
2 | Maxdd 7
3 | Maxdd 8</pre>
if i have to Delete ID 3 and later i add a new Record. It will continue as ID 4 but if you truncate(this not a Good idea) the table and add the Records to a Temp table and insert in the very same table from a temp table you will get the records with ordered ID.
Hope you understand this.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
modified on Friday, November 27, 2009 9:12 AM
|
|
|
|
|
Vuyiswa Maseko wrote: The Delete will not continue from the previous seed
Did you mean to say "The Delete will continue from the previous seed" ? Because this is what is correct.
|
|
|
|
|
Oops i fixed it thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Thank you guys I was just curious about the reason but now I understand
|
|
|
|
|
You are Welcome
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I have a dropdownlist who's datasource is a ObjectCollection. I have 3 variables within the Object. The Dropdown list works fine and shows the name variable from the object. Below is some code that explains what i'm doing however I get a compiler error that the cast can't be done.
int number = ((Object)dropdownlist1.selecteditem).num;
For some reason i get a cannot convert a type system.web.ui.listitem to projectname.int
Any ideas?
|
|
|
|
|
It is because you converted the selecteditem to an object which doesn't have the num property.
What is projectname.int? projectname is a class? Can you please show the code that you use to bind the dropdownlist?
|
|
|
|
|
Running VS 3.5 ASP.NET I can update text file in \res subdirectory, and
SQL database in \App_Data; but when I run same under IIS (5.1 under XP Pro)
it says 'access to path denied' for text file, and 'db is read-only' for SQL.
IIS is set to allow anonymous users; config is set to authentication None.
There is lots of information about how to protect your files, but nothing about how NOT to. Clearly some default protection is kicking in, but I have
been unable to figure out where or how to turn it off. Any help would be
greatly appreciated.
|
|
|
|
|
Hi,
Isn’t that ACL list problem? Right click to the file/directory -> properties -> security tab -> check if the ASP .NET user has permission to that object?
|
|
|
|
|
Thanks for responding, Petr.
You are quite right; but to be able to set ACL permits I had to turn off
simple file sharing. I have now tried doing this, and it seems to work.
I had originally assumed if it was on, any process would have access to everything. Does this mean that IIS ignores file sharing, and can't be used without that being turned off?
Also, I had thought that Windows permits would only come into play if
one used Windows authentication; I gather this means authentication and
authorization are unrelated. In which case what I still don't understand is
what happens in the case of web hosting: does it mean the hosting provider
has to go around setting my file permissions, and that I have no control
over that (except perhaps to restrict things)? For example, how do I ensure
my program can update my database, but others can't?
I would appreciate any further comments.
|
|
|
|
|
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.
|
|
|
|