This query can be used to identify the SQL Server Version and Edition currently in use on a server.
SQL 2005
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
SQL 2000
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
SQL 7.0 and earlier
SELECT @@VERSION
The following is a KB article for this.
KB 321185: How to identify your SQL Server version and edition
Thursday, September 04, 2008
Identification of SQL Server Edition and Version
Detecting the installed version of .NET
Open a command prompt and run the command
dir %systemroot%\microsoft.net\framework\v?.* /ad /b
This will list all the versions of .NET framework installed on the system
Friday, December 14, 2007
Using the Seapine TestTrack SOAP API
However, upon using the SOAP API, I kept getting the error
date' is an invalid value for the SoapElementAttribute.DataType property. The property may only be specified for primitive types
After spending some time with google and msdn, I found a couple of links which attributed the problem to incompatibilities in the proxies generated by .NET 1.1 and .NET 2.0.
Till this point of time, I was always using a live reference from my C# application to the web-service. Upon generating a proxy class using wsdl and replacing all
System.Nullable
Copy Paste between remote desktop and local computer
1. Network DDE DSDM
2. Network DDE
3. ClipBook
Network Dynamic Data Exchange (DDE) is a technology that enables applications on different Windows computers to dynamically share data. This sharing is effected via communications channels called trusted shares, which are managed by a service called the Network DDE Agent. By design, processes on the local machine can levy requests upon the Network DDE Agent, including ones that indicate what application should be run in conjunction with a particular trusted share. The DSDM(Distributed Share Database Manager), manages the shared DDE(Dynamic Data Exchange) network conversations (from shares like: \\computername\ndde$).
However, a vulnerability exists because the Network DDE Agent runs using the Local System security context and processes all requests using this context, rather than that of the user. This would give an attacker an opportunity to cause the Network DDE Agent to run code of her choice in Local System context, as a means of gaining complete control over the local machine.
Friday, July 06, 2007
Increasing Site Storage for SharePoint Portal Personal Sites
1. Go to SharePoint Central Adminsitrator
2. Click Windows SharePoint Services
3. Click Manage Quotas and Locks
4. Click Manage site collection quotas and locks
5. Enter the URL for the specific personal site (e.g.http://in-srv-qaapp)
6. Click View Data
7. Under Site Quota Information, select Individual Quota under Current quota information
8. Change the site storage limit and click OK
Sunday, May 13, 2007
Verifying .net assembly attributes recursively
I was once given the responsibility of verifying the assembly attributes of all the assemblies in a .NET solution prior to each release. This was a very monotonous job considering the fact that this had to be done manually. For two of the releases, I used to open the properties of each dotnet assembly and verify if the attributes were correct in the release version. In a better situation I would have gone through the assemblyinfo.cs in each project and verified it (which is no better), but sadly I did not have access to the versioning server.
I did a bit of soul searching and decided that this was not the correct way to go through it. I wrote a small win app that could be used to do this
FileStream txtfile;
StreamWriter sw;
private void btnCheck_Click(object sender, EventArgs e)
{
try
{
txtfile = new FileStream(txtOutputFile.Text, FileMode.Create , FileAccess.Write);
sw = new StreamWriter(txtfile);
txtDirectoryPath.Text = dlgDirBrowser.SelectedPath;
string directoryPath = txtDirectoryPath.Text;
DirectoryInfo directoryInfo = new DirectoryInfo(directoryPath);
TraverseFolder(directoryInfo);
}
catch
{
MessageBox.Show("Directory path incorrect");
}
finally
{
sw.Close();
txtfile.Close();
MessageBox.Show("Done. File created "+ txtOutputFile.Text);
}
}
public void TraverseFolder(DirectoryInfo directoryInfo)
{
foreach (FileInfo fileInfo in directoryInfo.GetFiles("projectname*.dll"))
{
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(fileInfo.FullName);
bool finalCheck;
finalCheck = (Assembly.LoadFrom(fileInfo.FullName).GetName().Version.ToString() == txtAssemblyVersion.Text)
&& (fileVersionInfo.ProductVersion == txtProductVersion.Text)
&& (fileVersionInfo.FileDescription == fileVersionInfo.OriginalFilename.Substring(0,fileVersionInfo.OriginalFilename.Length -4))
&& (fileVersionInfo.FileVersion == txtFileVersion.Text)
&& (fileVersionInfo.LegalCopyright == txtLegalCopyright.Text)
&& (fileVersionInfo.CompanyName == txtCompanyName.Text )
&& (fileVersionInfo.InternalName == fileVersionInfo.OriginalFilename)
&& (fileVersionInfo.ProductName == txtProductName.Text);
if (finalCheck == false)
sw.WriteLine(fileInfo.Name + " : Incorrect");
//else
// sw.WriteLine(fileInfo.FullName + " : Correct");
}
DirectoryInfo[] directories = directoryInfo.GetDirectories();
foreach(DirectoryInfo newDir in directories)
{
sw.WriteLine(" ");
sw.WriteLine("Directory: " + newDir.FullName);
TraverseFolder(newDir); // recursive call
}
}
Managing remote connections without tsadmin
However, Windows XP does provide the following to perform this action
- qwinsta (Query Windows Station)
qwinsta /server:servername allows the user to view the sessions and obtain the session ids on a remote windows host
- rwinsta (Reset Windows Station)
rwinsta sessionid /server:servername
Monday, January 22, 2007
Deploying a Windows 2003 cluster using VMWare
Whenever a virtual machine was powered on, it used to lock the vmdk files thus not allowing the second node in the clustered to be powered. After some searching on various blogs, I was able to work around this problem by modifying the vmx file of the virtual machine to include the following statements (without the comments)
scsi0:sharedbus="virtual" //this shares the whole scsi bus 0
scsi0:0.shared="true" //this shares the scsi0 port 0
disk.locking="false" //for disk.
Removing the Quick Lauch in Sharepoint sites
< style>
.ms-navframe
{
display: none;
}
</style>
Wednesday, March 29, 2006
Mounting ISO files
mount -o loop -t iso9660 isofilename mountpoint
Tuesday, January 24, 2006
Populating a combo box with enumerations
private void populatecbo(System.Type enum_type, System.Windows.Forms.ComboBox combo)
{
Array arr_populate = Enum.GetValues(enum_type);
combo.DataSource = arr_populate;
}
A cast to type using typeof(enum_type) would be required during the call
Also retrieving the value would be easy
(enum_type)System.Enum.Parse(typeof(enum_type), combo.SelectedValue);
Monday, January 23, 2006
Opening Excel files in a browser in ASP.NET
string fileName = Server.MapPath("HelloWorld.xls");
Response.ContentType = "application/vnd.ms-excel";
Response.WriteFile(fileName);
However, this was opening the file in the same webpage and the back button was not having the desired effect of moving back to the initial page. After some attempts I found a simple way to get that to work correctly:
I declared a class
public class ExcelFile
{
public static string excelFileName;
}
set the static variable to the required filename, redirected the output to another page and used the same code in the page_load event:
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
Response.ContentType = "application/vnd.ms-excel";
Response.WriteFile(ExcelFile.excelFileName);
}
Monday, January 16, 2006
VMWare Player
More information in this regard would be available at :
http://www.vmware.com/products/player/
Saturday, December 24, 2005
AJAX
I read quite a bit about AJAX lately and was amazed by the simplicity and the efficiency that it brought about in web applications. However I realized that this was not something new. The most interesting thing in this is the reduction of postbacks leading to improvement in performance. About a couple of years back, one of my friends had shown me a online chat demo available at http://www.volano.com which implemented something like this. The primary reason of the hype for AJAX seems to be because big players like Google have implemented it (gmail) and there are other ambitious projects like WebOffice.
Tuesday, December 13, 2005
Memory leaks and Undisposed objects
Recently while working on a couple of issues related to memory leaks due to undisposed GDI objects, I came across this excellent post related to using tools to track down and eliminate memory leaks in managed code.
A couple of posts had a great sense of humor
A few good (performance) men
10 reasons why you should subscribe to my blog
Hats off to Rico Mariani.
Sunday, December 04, 2005
CompactFramework and Virtual Machines
I have worked for quite some time on Virtual machines and have also worked on CompactFramework in Dotnet. However I have never been able to run an emulator on a virtual machine using DotNET 1.x. There were many explanations that I had come across in this regard
1. There cant be two layers of virtualization.
2. The WinCE emulator uses the same engine as Virtual PC. (Both have been developed by Connectix). Virtual PC2004 and Virtual Server 2005 are based on this engine and so it is not able to run a copy of the emulator inside itself.
However I did some research on this and was not convinced with either of the reasons. VS.NET 2.0 (Whidbey) allows an emulator to be run from within a Virtual machine. The reason may be that this uses a different emulation engine. Also, when I had tried to run an emulator from a VMWare virtual machine, it failed to run on that too. I feel that I need to gain more gyan on this.
Gecko browsers and ASP.NET
ASP.NET has left me high and dry when I try to render web apps on a Gecko browser. I aint sure why this happens, but sometimes scrollbars appear on different parts of the browser, CSS styles appear to have taken a beating. I did a little googling on this and found out that it is not just ASP.NET but IIS also, which may be responsible for this.
The following modifications were suggested in the web.config file
< browserCaps >
< !--Gecko based browsers //-- >
< case match="^Mozilla/5\.0 \([^)]*\) (Gecko/[-\d]+)? (?'type'[^/\d]*)([\d]*)/(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*)).*" >
browser="Gecko"
type=${type}
frames=true
tables=true
cookies=true
javascript=true
javaapplets=true
ecmascriptversion=1.5
w3cdomversion=1.0
css1=true
css2=true
xml=true
tagwriter=System.Web.UI.HtmlTextWriter
< case match="rv?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*))" >
version=${version}
majorversion=${major}
minorversion=${minor}
<case match="^b" with="${letters}" >
beta=true
</case>
</case>
</case>
</browserCaps>
There was another suggestion to use the following in the @page directive
clienttarget="IE5"