.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Check for valid version number

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :.NET Framework
Hi,I want to check whether given string is a valid version or not. If any string is in form of then it should return true, else if it contains any text or which is not any version format, it should return false.Any idea on this. Thanks for your help.

View Complete Post

More Related Resource Links

Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).

How to apply color to selected number of items in check box list and drop downlist

Hi all,    I want to apply color to selected number of items in checkbox list and seleted number of items in drop downlist for e.g color red for few items and black (default). I have a bit value set in data base so if bit is set to 0 then red and if 1 then back. Please help me.  

Version number syncronisation between document libraries

When I perform a Move or Copy operation from one Document Library to another in SP 2010 (using Send To or Manage Copies feature) SP resets the version number to 0.1 even if the version number in the source library is 4.2 (for example). All other Metadata is copied correctly. Is their anyway to keep version numbers in sync between document libraries? Seems like quite an obvious requirement to me but could not see any other info on the net about this.. thanks in advance

Cumulative Update 5 - wrong SQL 2008 version number


Hi all,

I installed Service Pack 1 for SQL 2008 on one of my servers. This server has multiple instances. In this case, it is the instance "SHAREPOINT2010" that is giving me difficulties.

For Sharepoint 2010, we need to install cumulative update 5. This update fails due to the fact I do not have the correct SQL version. It is expecting version 10.0.2531 (SP1), but it says I have the 10.0.1600 (RTM). When I check in my management studio and via the @@version, I do see the confirmation I have version 10.0.2531. (also see attached screenshot).

Does anyone know why the cumulative update fails to see the correct server version ? If I try to install it on another SQL 2008 SP1, it works fine..;

Thank you !



screenshot sql version

Version Check SP and Location Log Files


My SQL Server 2008 Standard is showing Verson 10.0.2531.0.   Is ths SQL 2008 SP 1?  What is the latest SP for SQL 2008 Standard?  

I want to check that my log files are truncating properly during my Full backup.   How can I find the path for where the log files are stored? 

Thanks - NC Beach Bum

NC Beach Bum

Question about Workflow in Document Library with version control and check-in/out enabled



I use Sharepoint Foundation 2010 and have a workflow to set some metadata in a document with version control and check-in/check-out enabled (approval content is not enabled because anyone in the team can be a possible editor of the document).

My metadata is:

- a generated doc id with text+id (example P&D_1)

- a calculated status based in version: minor version = "on development" and major-version="published/approved"

I defined two workflows:

1) is called when item is created to define id and status.

2) is called when item is updated and status is re-calculated if version is major. (It is called in every item change, not only when user wants to publish a major version, because this option doesn't appear in SPD)

I noticed that sharepoint workflow must do a check-out to be able to update metadata, and because of this the version number is incremented. When version is minor, I don't care, but when version is major I have a problem, because just after publishing the version 1.0, the workflow changes metadata and the version to 1.1. and 1.1 means that the document is not approved anymore...


a) Isn't it possible to do the workflow to check-in and override the last/current version to not generate a new version??

b) Or is it possible to stop versi

sql 2008 installation question, windows installer version check?


sql 2008 installed, but didn't get pop up for windows installer 4.5, though intallation complete, but still wants to confirm the windows installer version, however, the windows 2008 seems not like w2k3 to show all windows components you installed, I only see .net 3.5sp1 on the appwiz.cpl

Check trial and registration version software and his activation



My question is

     When the user opens the application for the first time after installing it they should be prompted to either enter a registration code or activate the     30-day trial.  The user should not be able to use the application before first activating a trial period or registering the software.

 - algorithim  is needed that generate key which match the installed software code.

Please let me know if any one have any soluation for this problem.






Bug: Valid number throws an overflow error.


I have a major problem. Things were going great until I came across this little bug(?) which has thrown a stick in my spokes. As I will demonstrate below, it seems that when defining certain numbers Visual Studio will throw an overflow error and I have no idea how to resolve this issue.


Dim T As ULong = 14774537964905701134 'Overflow error in the IDE

Dim M As ULong = ULong.MaxValue '(18446744073709551615) we are below the maximum value so it should work, right?


The one solution I have found is that we can use the following declaration instead.


Dim T As ULong = ULong.Parse("14774537964905701134")


However, to make matters even more complicated the value in question is unknown and must be compiled using CodeDOM so using the Parse method isn't an option. Unless there is some way I can determine if that value in particular will give me an overflow error. Any solutions or workarounds would be greatly appreciated, thanks for your time.

Faulting application , version ,faulting module kernel32.dll


Hi, I have one windows application built using C# and .net framework 2.0 and its installed on Windows Server 2003.

I have tested application on my machine and it works perfectly on my machine. Only difference between two machines is that, my machine has Windows Vista OS and machine on which error occured has Windows Server 2003 OS.

When I start application, it works correctly for some time but then gives one error as

Faulting application , version ,faulting module kernel32.dll,version 5.2.3790.4480, stamp , debug? 0. fault address 0x000bef7.

Source : .NET Runtime 2.0 Error Category : None Event ID : 1000

Does anyone knows why this error is coming? I googled for this error but most of the solutions were for either explorer.exe or internet explorer.

Thanks and Regards, Chandrashekhar

Change document version number via database


Hi all,

I was blocked by an issue of document version number. The customer wants to move a document from one document library to another. After the document is moved, version number should be kept the same and metadata values of each version should also be kept.

File.MoveTo(string newUrl) method can move file and keep the same version number but lose the metadata in previous versions. Only the latest version has metadata values. Also this method cannot move file cross site collections.


Following is my solution:

1. Upload all the versions along with metadata to the new location and then delete the old file.

2. Update document version number in database directly.

Finally the solution works well, but I don't know if step2 will impact any other default logic in SharePoint system. Below is the logic to update version number.

            SqlConnection cn = new SqlConnection(connStr);
            SqlCommand cmd;
            string cmdTxt;


            cmd = cn.CreateCommand();

2008 R2 Web Service URL - just shows empty page and SQL version number


In SQL Server 2008 R2 I installed reporting services.


When I go into the Reporting Services Configuration Manger and then Web Service URL and click the hyperlink it just goes to an empty looking page.


localhost/ReportServer - /


Microsoft SQL Server Reporting Services Version 10.50.1600.1 

The Report Manager URL works fine.

I have uninstalled and re-install Reporting Services two times now and changed the URL address several times too.  Still it's always stuck on this page.

Any ideas?


Conditional Formatting - Verify a number of check boxes have been checked before showing a button?


I would like to Hide a Submit button until all the check boxes are equal to true? How would I go about verifying all boxes equal true?

Temp folder not valid check


I gave the asp.net account no access to the Temp folder it that it needs to write to because I'm trying to figure out how to test this scenario if a file upload couldn't write to a user's temp folder.  When I did that I got this error:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\dmand2\cf54e686\f7fc03db\App_Web_login.aspx.eb25565c.p3bndiob.dll' -- 'Access is denied. '

Source Error:

[No relevant source lines]

Source File:    Line: 0

How would you debug this so that you can show the user something other than a page like this? I can't figure out what page to go to to debug it.



How to check whether the current workflow is valid? Is WorkflowDesigner.IsInErrorState() working?


How to check whether the current workflow hosted in a workflowdesigner is valid?

I tried calling WorkflowDesigner.IsInErrorState() everytime WorkflowDesigner. ModelChanged event fires.. but it always return false (ie no error) even though I see the red error sign in the designer!

any idea?

'TDS Protocol stream is not valid' error when running SQL Server 2008 with jdbc driver of version


I am using SQL Server 2008 on Windows Server 2008 R2 and one of our servers running as a windows service (on Windows Server 2008 R2) contacts the SQL Server 2008 in a timely fashion to get some information. During one of these runs, we encountered the following error logs in the service logs and thereby we took a hit in serving client requests. The jdbc jar that is used for database connectivity is of version 3.0 (sqljdbc.jar).


I can provide more details on this issue. Can someone please let us know why this can be occurring ? Just so you know, the set of errors repeats itself after sometime although on a different JDBC Connection (with different ConnectionID). We have a reconnection algorithm running in case the JDBC Connection is lost for some reason (but I would be surprised if this issue relates to the re-connect algorithm).


INFO   | jvm 1    | 2011/02/28 22:26:54 | Feb 28, 2011 10:26:54 PM com.microsoft.sqlserver.jdbc.TDSParser throwUnexpectedTokenException
INFO   | jvm 1    | 2011/02/28 22:26:54 | SEVERE: TDSReader@4686d ( ConnectionID:25 TransactionID:0x0000000000000000): FetchBufferTokenHandler: Encountered unexpected TDS_RET_STAT (0x79)
INFO   | jvm 1    | 2011/02/28 22:26:54 | Feb 28, 2011 10:26:54 PM com.microsoft.sqlserver.jdbc.TDSReade

Check All with JQuery and a Asp.Net GridView

Display a Grid on the screen with a checkbox in each row. At the bottom of the page have "Check All" button.

Typically if I need to do anything interesting I use a template column. So my GridView will look like the one below (most other columns removed for readability). The only interesting point to note is the CssClass="ApprovalCheckBox" in the CheckBox ItemTemplate.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend