|
Now think about the implementation details of a protected collection. Most if not all collections are built on top of an array, which gets reallocated and copied every time the capacity becomes insufficient, and which gets insert/remove-shifted on each insertion or removal.
Such collection can have any number of users (methods, possibly active on different threads), each possibly holding one or more enumerators; each enumerator has its own state. Now insert or remove a collection item; how could the collection tell which protected enumerators get affected by the modification, and which don't (because they are already past the insertion/removal point). The natural way would be one of these:
1.
inside the collection, keep a collection of current enumerators and check each of them on every modification, not a pretty situation. (Note: there are life issues, probably needs WeakReferences)
2.
for each enumerator, create a copy of the array, basically cloning the collection. An expensive operation.
The current .NET behavior can easily be accomplished by having a "generation number" which is stored in the collection, incremented on every insert/remove, and gets copied into the enumerator when it gets created, then compared on every Next(). None of these are expensive, memory wise of cycle wise.
|
|
|
|
|
My contract could be just as easily honored. All any of the existing collection classes would have to do honor my 'improved' contract would be to behave exactly as they already do.
My complaint with the Microsoft's iEnumerable contract is that rather than merely requiring an enumerator to throw an exception if the collection has been modified in a way the enumerator can't sensibly handle, it requires that the enumerator throw an exception if the collection is modified, period. That seems unduly harsh.
If someone codes a collection using e.g. a linked list, such that insertions and deletions can be handled without disturbing enumeration (subject to the constraints I listed), is there any reason to forbid its enumerator from operating through insertions and deletions? I know that, from a practical standpoint, Microsoft isn't going to break the kneecaps of any programmer who has the audacity to do such a thing, but it still seems irksome that the best approach would be something Microsoft has declared to be wrong.
|
|
|
|
|
|
I don't think this is new or strange. You obviously can't use upper versions of framework components from lower versions.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Actually I just had a similar experience:
a solution with one 3.5 EXE project referencing two 2.0 DLL projects; it was created long ago with 2008 without any problem (initially it was all 2.0, but then the EXE needed some LINQ and I never got around to modify the DLL targets). When ported to VS2010 I had to modify the DLL projects so they now all target the same framework.
|
|
|
|
|
Yes, but why VS2008 did not make this a problem on compiling?
I agree with you when you say you can't use upper framework form a 2.0 assembly, 'cause, for example it can be deployed on a win2000 or on a machine without .NET 3.0.
But as I say in my previous post, I'll deploy this solution on .NET 3.5 ready machines; only a bug/limit of Cobol<->.NET bridge force me to compile only this Cobol-.NET-interface-assembly in 2.0.
However, I found the trick: reference System.Core.dll (or other dll needed by your referenced assemblies) by hand.
Thanks!
Nando
Jesus
|
|
|
|
|
Hi,
Currently i am using VS 2008 in my PC, now i am planning to install VS 2010 Ultimate in my PC. is its going to effect to my existing applications,if i install this . i want to use my VS 2008 Applications as it is(Don't want to upgrade existing Applications). please suggest me. if it's effects i will roll off from the idea of installing VS2010.
Thanks in advance..
fttyhtrhyfytrytrysetyetytesystryrty
|
|
|
|
|
No problems here so far. It insists on capturing the .sln extensions and wanting to convert them, but that's minor annoyance. Just tell it to eff off.
|
|
|
|
|
You can use both side-by-side.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Public Sub s_zoekEntiteit(ByVal i_entiteit As String)
Dim sqlStr As String = "zoekEntiteit '" & i_entiteit & "'"
Dim dataAdapter = New SqlDataAdapter(sqlStr, m_constring)
Dim commandBuilder As New SqlCommandBuilder(dataAdapter)
Dim DataGridTable As New DataTable()
dataAdapter.Fill(DataGridTable)
Form5.ListBox1.DataSource = DataGridTable
Form5.ListBox1.DisplayMember = i_entiteit
Form5.ListBox1.ValueMember = i_entiteit
End Sub
The Stored Procedure:
CREATE PROCEDURE zoekEntiteit (@tmpEntiteit nvarchar(40))AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT @tmpEntiteit FROM tblProduct;
--'ByVal i_prodid As String, ByVal i_prodnaam As String, ByVal i_prodomschrijving As String,
--'ByVal i_prodprijs As Int16, ByVal i_prodinstock As String)
END
The RESULT if @tmpEntiteit would be ProdID :
Image to Result
What is wrong here I keep getting an error on ' Form5.ListBox1.ValueMember = i_entiteit' the following error : Can't bind to the new DisplayMember. Paramater newDisplayMember
|
|
|
|
|
I expect its because you don't have a column called i_entiteit in your datatable - your stored procedure returns a column name of (no column name), but as it simply returns the value you pass to it anyway its pointless.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
i am using 3tier design in .net framework,i got two tables called category and menus so i want when i click the button to display in listbox only those who belong in that category..
|
|
|
|
|
And the question is .....?
You haven't provided a question, nor your code, nor any error messages you've gotten, ..., nothing we can use to diagnose your problem.
|
|
|
|
|
Write a query to fetch the appropriate data (those who belong to that category) and then pass it onto the listbox.
|
|
|
|
|
You have not make it clear what how your 3-tier design is related, but concerning your two tables "category" and "menus" you can try INNER JOIN with ON condition which relates the key values in both table.
----------------------------------
Hope it will help you.
|
|
|
|
|
Please provide some detail on your question
so that it is more clearer to answer it.
Jinal Desai
|
|
|
|
|
Hi
can any one help me out in finiding
how to get the mac number of the client system when my application is running in a common server in asp.net
Thanks in advance
Regards,
Gayathri Devi S
|
|
|
|
|
You'll have to seacrh the arp cache. You can find the arp cache in the System.Management; do a query for WIN32_NetworkAdapterConfiguration, and then filter by IP address.
You'll require a full trust environment for this. Note that is NOT the client mac address, but the MAC address of the next hop, if you're connected to a router, or of the bridge if you're connected to a bridge. This will only work in lan environments where clients are connected to switches or hubs.
example here[^]
|
|
|
|
|
Thanks for ur answer
But i need it to view my client mac address
is there anyway to find it using asp.net
|
|
|
|
|
No. It's just not available. The only way to get it is to persuade the client to give it to you.
|
|
|
|
|
No. Information like this is outside the browser security sandbox, and may not be available in the same way because the user could be using a Mac or Linux box. When you think about it, would you really want javascript code (that's what it would have to be), to be able to gain access to client data? This would represent a security hole.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: a Mac or Linux box
Or a dumb terminal?
|
|
|
|
|
ASP.NET code runs on the server side, not the client.
There is no way for you to get the clients MAC address from the server.
Even running client-side JavaScript or some other component will not allow you to get that information without the client granting your component full trust, and that's rare to find.
BTW: The MAC address is NOT a globally unique identifier.
|
|
|
|
|
Dave Kreskowiak wrote: The MAC address is NOT a globally unique identifier
But... but... the presenter at the launch event I went to last week said it is.
|
|
|
|
|
Why do they allow crask-smoking idiots to pollute the masses with bad information?
Each vendor ID part of the MAC address is limited to 16.7 million different addresses. The chances of a duplicate are actually pretty good. And I can speak from experience that it is possible to have to NIC's on the same subnet with the same MAC address. Real fun to troubleshoot that problem - great times!
|
|
|
|