Questions tagged [system.version]

10 questions
28
votes
3 answers

Datatype for System.Version in sql server

What is the best way to store System.Version in SQL Server? When I use varchar type, result of order by asc is: 1.0.0.0 11.0.0.0 12.0.0.0 2.0.0.0
Omid Mafakher
  • 1,389
  • 1
  • 16
  • 40
24
votes
2 answers

Why System.Version in JSON string does not deserialize correctly?

Context: I need to pass an object containing a large number of properties/fields (to UI Layer from Middle Tier Layer). Among this list of properties, one is of type Version which is not getting deserialized correctly from JSON string format. I have…
monish001
  • 671
  • 2
  • 8
  • 20
17
votes
2 answers

Java equivalent of .NET's Version class?

Is there a Java equivalent of .NET's System.Version class? How do I say this in Java? Version myVersion = new Version(2, 1);
Jason Crease
  • 1,896
  • 17
  • 17
2
votes
1 answer

Version strings to "System.Version" too long (or short) in PowerShell

How can I force conversion to type System.Version in PowerShell, or more likely, better understand why I cannot arbitrarily assign number strings type System.Version? We ingest some software updates in folders whose titles include version numbers.…
branpurn
  • 25
  • 4
2
votes
2 answers

Why is .NET System.Version "2.0" different from "2.0.0.0"?

I recently ran into a snag when this compare failed: System.Version compareVersion = new Version(2, 0, 0, 0); System.Version actualVersion = new Version(2, 0); if(actualVersion >= compareVersion) // returns false I understand the implementation…
Dee J. Doena
  • 1,631
  • 3
  • 16
  • 26
1
vote
1 answer

The LINQ expression could not be translated System.Version.Parse

I am using EF and I'm trying to query some records which have a version column like this: var servicesWhichExistInDifferentDataCenters = dbContext.CurrentRunningServices .Where(r => r.DeployedRing == ring && r.DataCenter ==…
CodeMonkey
  • 11,196
  • 30
  • 112
  • 203
1
vote
1 answer

Cannot convert value to type "System.Version"

I cannot convert a properly formatted string stored in a variable into a version type. The issue must be with the variable as it works fine if I provide the value manually but I don't know what could be wrong with it. I am new to PowerShell so I'm…
Bluonic
  • 11
  • 1
  • 2
0
votes
3 answers

Why is the 'System.Version' a reference type (class) and not a value type (struct)?

If I look at the members of the .NET type System.Version it might be a better idea to create such a type as value type (C# struct) instead of a reference type (class). What might be the reasons or arguments that Microsoft decided to implement that…
user432219
0
votes
1 answer

Can't save type System.Version to My.Settings

I have a small test project for checking application version from a server and prompting a user to update. Everything works fine except that I can't save a type of System.Version to My.Settings. (I want to save the new version in case a user…
SteveCinq
  • 1,920
  • 1
  • 17
  • 22
-1
votes
3 answers

system.version more than 3 decimal points c#

I am currently receiving the following error - "Version string portion was too short or too long" When using this statement - records = records.OrderBy(r => new Version(r.RefNo)).ToList(); To order a list of string's called RefNo. It fails on…
bsod_
  • 903
  • 8
  • 27