|
|
.net 3.5 Version Is Easier to use
|
|
|
|
|
|
The answers given by Abhinav and Dave Kreskowiak are absolutely correct.
I want to add that
.NET 1 and 1.1 are now obsolete.
Even though Visual Studio 2008 and above provide multi targeting feature, there is no support for .NET 1 and .NET 1.1.
The size of .NET 2 is less, around 22.5 MB. With the introduction of generics and other improvements in .NET 2, I think, if there is a concern about the size of deployment, .NET 2 can still be used, if there is no specific requirement for new features available in the later versions.
For some features like, extension methods and LINQ to objects there are certain work arounds to use them in .NET 2 also.
|
|
|
|
|
I am developing an application called mysql query browser in C#.net. I have to mention hardware and software requirements in my SRS.But I dont know how to know what are these and what is the reason behind this....so plz tell me....I am using .net 3.5..thanks...
|
|
|
|
|
The reason is very simple.
Imagine trying to run the application you are building on a machine that does not have the framework installed or on a system that does not have Windows.
It wont work!
As a result, you need to list out the minimum requirements that your application needs to run.
|
|
|
|
|
Hi,
Hardware Requirements: The computer hardware to run your application (Like: Minimum RAM required, Hard Disk Space needed, Processor (Dual core, i3, i5, P4))
Software Requirements: The softwares wihout which your application will not run (Such as Operating System (Windows7, WinXP, Linux etc),.NET framework (if required), Windows Installer etc.)
I have just giving you the example, but the actual requirement you have to know.
Happy Coding...
|
|
|
|
|
how can i debug asp.net (vb) code on visual studio 2003 in windows 7
visual studio properties;
When I checked the ASP.NET debugging,
I get "Error while trying to run project: Unable to start debugging on the web server" error message...
I am waiting your kind helpness ...
Thanks,
|
|
|
|
|
|
Hey All,
(Using VB.NET 2010)
Hitting a bit of a roadblock.
So currently in my application I have a Global Collection that is a Collection of Collections.
Currently I am trying to add items/elements to one of the child collections of the Global Collection but I am unable to use the collections methods of the child.
When I assign a variable to the child collection and return the collection it is just an object with the collection inside.
Ex:
Dim GlobalCollection as New Collection
Dim ChildCollection1 as New Collection
Dim tempCurrentCollection
GlobalCollection.Add(ChildCollection1, "Key1")
tempCurrentCollection = GlobalCollection("Key1")
At this point the tempCurrentCollection is an object that contains the collection, of which I can't access any Collection methods.
Ex:
tempCurrentCollection (Object Type)
|-ChildCollection1 (Collection Type)
What I need is to be able to do the following:
tempCurrentCollection.Add(DataObjectA1, "DataA1")
So I have the following hierarchy:
GlobalCollection
|
|-ChildCollection1
| |-DataObjectA1
| |- ...
| |-DataObjectAn
|
|-ChildCollection2
| |-DataObjectB1
| |- ...
| |-DataObjectBn
|
|- ...
|-ChildCollectionN
Thanks a bunch for any help, appreciate it.
|
|
|
|
|
Dim GlobalCollection as New Collection
Dim ChildCollection1 as New Collection
Dim tempCurrentCollection as Collection
That should give you intellisense on the temp object
Bastard Programmer from Hell
|
|
|
|
|
I am new to the vb.net language and there seems a few ways to accomplish accessing items from another class.
My question, what would be best or proper method or why would use 1 method over the other..
Again I am generally new at this and would greatly appreciate knowing what is preferred and why would you use 1 method over the other.
Shared items.
Class1
Public shared sub1
end sub
end class
Then in class2 use class1.sub1.
----------------------
or use an instance.
Class1
Public sub1
end sub
end class
then in class2 use
Dim Myclass1 as new class1
( or should it be Dim Myclass1 as class1 = new class1)
then use myclass1.sub1....
------------------------------
or use inherits
Class1
Public sub1....
end sub
end class
then in class2 use
inherits class1
then use sub1.....
Thanks for any info
Steven
|
|
|
|
|
You group methods together in a class. If those objects take similar parameters, then it's kind of convenient to make an "object" of it, storing the parameters right next to the methods that are going to interact with them. Compare this;
Structure SomeStruct
Public Bla As String
End Structure
Class MyClass
Shared Sub DoSomething(ByVal someBla as SomeStruct, Byval No as Integer)
End Sub
Shared Sub DoSomethingElse(ByVal someBla as SomeStruct, Byval s as String)
End Sub
End Class
Dim x as SomeStruct
MyClass.DoSomething(x, 1)
MyClass.DoSomethingElse(x, "Hello")
To this;
Class MyClass
Private _someBla as someStruct
Sub New(someBla as someStruct)
_someBla = someBla
End Sub
Sub DoSomething(Byval No as Integer)
End Sub
Sub DoSomethingElse(Byval s as String)
End Sub
End Class
Dim x as SomeStruct
Dim newClass as new MyClass(x)
newClass.DoSomething(1)
newClass.DoSomethingElse("World")
You use "shared" if you don't interact with any properties of the object.
Bastard Programmer from Hell
|
|
|
|
|
I have a client program that uses a webservice for communication with its server. Up to now all calls to the webservice have been synchronous, but now they must be made asynchronously. The webservice has been wrapped into classes that handle and log communication errors and perform all conversions between entities and the structs used by the webservice. This way the client is practically unaware of the existence of the webservice and might as well be sitting on top of the application logic on the server. This compatibility will be lost when using asynchronous calls (the real application logic does not provide any methods and callbacks for asynchronous calls), but that is not really important. It would only have been useful in some testing scenarios where we might have wanted to take the webservice out of the picture.
Inside the wrapper classes, an asynchronous call will look something like this:
public void GetSomeEntityBySomeParameter(int SomeParameter)
{
try
{
this.Webservice.GetSomeEntityBySomeParameterAsync(SomeParameter);
}
catch(Exception e)
{
}
}
private void Webservice_GetSomeEntityBySomeParameterCompleted(object sender, SomeEventArgs e)
{
SomeEntity Result = null;
try
{
if(e.Result.ErrorReport != null)
{
}
else
{
Result = ConvertSomeStructToEntity(e.Result.Value);
}
OnGetSomeEntityBySomeParameterFinished(Result);
}
catch(Exception e)
{
}
}
This last step, notifying the object that requested the data, is the part that gives me trouble. A separate thread has been started for the asynchronous call and also the Webservice_GetSomeEntityBySomeParameterCompleted() method will be called from that thread. Once I'm done and raise my own event, the event handler of the caller will also be executed by that thread.
That's wrong in many ways. Usually the calls will be initiated from some object around the UI. The UIs from Microsoft simply throw an exception when changes to the UI are made by another thread. In this case the UI is not from Microsoft and reacts very well to multithreading, but there still are side effects. Also, it is simply unacceptable to lose control over which part of the code is executed by any given thread.
In the end I need some safe way to raise the GetSomeEntityBySomeParameterFinished event, so that its event handler is executed by the same thread that requested the data. I'm very careful here because pulling a thread away from what it is currently doing and making it do something else instead (if that's possible at all) is just asking for even more trouble
Edit: Added some typical exception handling, just for the sake of completeness
Edit^2: I have been looking at the System.Windows.Threading.Dispatcher class, which seems to do what I want to have. Unfortunately, as the namespace tells, that's WPF and I can't afford to include WPF just to get to use this class. Also, things like Control.Invoke would not help, even if the UI had such methods. My problems seem to come from a race condition in the presenters, which are not UI classes.
I'm invincible, I can't be vinced
modified 4-Apr-12 9:39am.
|
|
|
|
|
CDP1802 wrote: In the end I need some safe way to raise the GetSomeEntityBySomeParameterFinished event, so that its event handler is executed by the same thread that requested the data. I'm very careful here because pulling a thread away from what it is currently doing and making it do something else instead (if that's possible at all) is just asking for even more trouble
Everything is possible; a thread is usually a loop with work, until work is done and the thread exits. You could have a check inside that loop that checks for certain conditions or events and have it act.
There's various ways to have the thread check for conditions (like a thread-safe flag), but you might want to AutoResetEvent[^] class.
Bastard Programmer from Hell
|
|
|
|
|
As it seems, the System.Windows.Threading.Dispatcher class was designed just for such a case. It allows to raise an event that then is handled on the thread that the Dispatcher was created for. MSDN did not provide too many details, but it appears that pending events are put into a queue and the thread checks the queue and calls the event handlers. There we basically have the thread's loop that does the checking, hidden away in the framework so that the application does not need to take care of any details.
The problem is that this class is in a WPF namespace. It would work, but then I would lose the option to target other framework versions and platforms where the WPF namespaces don't exist. Two candidates would have been WinPhone 7 and the XBox. But why did they put this class into the WPF namespaces? It would be really helpful in many other cases, not just when some UI is involved.
And I still think that the complete loss of control over which thread gets to execute a callback for an asynchronous operation is very problematic. It's a real complication to make all classes that need to call to the webservice thread safe.
I'm invincible, I can't be vinced
|
|
|
|
|
CDP1802 wrote: The problem is that this class is in a WPF namespace. It would work, but then I would lose the option to target other framework versions and platforms where the WPF namespaces don't exist.
Do you have Reflector or ILSpy installed? If yes, then it's always worthwhile to see if you can reimplement it in a separate assembly (meaning, if it's a simple thing without too much references)
Bastard Programmer from Hell
|
|
|
|
|
Have you investigated the BackgroundWorker class?
BackgroundWorker Class[^]
"It's not what you don't know that will hurt you the most, it's what you think you know that isn't so." - Unknown
|
|
|
|
|
I tried to format a double using ToString("f2", System.Globalization.NumberFormatInfo.CurrentInfo) . The NumberGroupSeparator is a single space, the NumberDecimalSeparator is a comma.
Hence I'd expect 3501.30 to be formatted as 3 501,30 , but I get 3501,30 (i.e. the space after thousands is missing).
It is in a C# WPF application (value is not bound to a control, but to be writte to a text file) with .NET 4 on a Win 7 64 bit (German) OS.
Is that a bug in the framework, or must I use some tricks?
|
|
|
|
|
Bernhard Hiller wrote: Is that a bug in the framework
"SELECT" isn't broken.
You're formatting it as a fixed point number. Try the one below;
static void Main(string[] args)
{
Console.WriteLine(
3501.23.ToString("N2", System.Globalization.NumberFormatInfo.CurrentInfo));
Console.ReadKey();
}
Bastard Programmer from Hell
|
|
|
|
|
Thanks! What a difference...
|
|
|
|
|
You're welcome
|
|
|
|
|
|
I am trying to write a program to select a feature using mouse click on a map control of DotSpatial framework. But I am stuck.
Please Help..
Thanks.
|
|
|
|
|
I am pretty sure that DotSpatial has a forum. I guess that's a great place to find an expert in it.
|
|
|
|