Posts

Showing posts from 2012

Find a character or string with in procedures or views or triggers

Find a character or string with in procedures or views or triggers SELECT   DISTINCT  so . name , sc . text FROM   syscomments  sc INNER   JOIN   sysobjects  so  ON  sc . id = so . id WHERE  so . xtype  in   ( 'P' , 'TR' , 'V' )   and  sc . TEXT   LIKE   '%sy%' order   by  name

Padding Leading Zeros to a Number

Dim MyNumber As Integer = 472 TxtFormattedNumber.Text = MyNumber.ToString().PadLeft(5, "0") ------------------------Output--------------------------------------- 00472

Generate Dynamic AlphaNumeric Values in SQL Server

declare @AuthKey varchar(255) set @AuthKey = '' select @AuthKey = @AuthKey + char(n) from (     select top 15 number as n     from master..spt_values     where type= 'p' and (             (number between 48 and 57)  -- numbers       or    (number between 65 and 90)  -- uppercase letters       or    (number between 97 and 122) -- lowercase letters     )     order by newid() ) as t print @AuthKey

Send Mail From Gmail Using Vb.net Program

Try Dim mail As MailMessage = New MailMessage () mail.To.Add( "yyyy@gmail.com" ) mail.From = New MailAddress ( "xxxx@gmail.com" ) mail.Subject = "Email using Gmail" Dim Body As String = "Sending mail using Gmail's SMTP" mail.Body = Body mail.IsBodyHtml = True Dim smtp As SmtpClient = New SmtpClient () smtp.Host = "smtp.gmail.com" smtp.Credentials = New System.Net. NetworkCredential ( "xxxx@gmail.com" , "xxxx" ) smtp.EnableSsl = True smtp.Port = 587 smtp.EnableSsl = True smtp.Send(mail) Catch ex As Exception MessageBox .Show(ex.Message) End Try End

SQL Server Remote Connection Issue

If you have recently installed SQL Server 2005/2008, for security purposes, external and remote access is not enabled by default. If you try to connect to a SQL Server database from an external machine you may see one of the following errors.  ISSUES/ERRORS ·          SQL server does not allow remote connections ·          SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified ·          An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005/2008,this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.(provider:Named Pipes Provider,error:40-Could not open connection to SQL Server)) ·          Server does not exist or access denied ·          A...

Unable to open the physical file "D:\MSSQL\Data\dbAcquisitionStaging_Data1.mdf". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)

This problem occurs when you migrate the operating system. example if you are using Win Xp and migrate to Windows7 and when you try to attach the mdf files. This error occurs. Resolution : 1. Make sure you are logging with the same user name and password for SQL server. 2. You should have complete access to the mdf files. Full permission. 3. Restore with windows authentication. I had the same problem and i have restored it successfully. i have even tried with 32bit and 64bits win7 OS. Hope this will reslove your Issue.

IE8 not recognized in ASP.Net 1.1 applications

Our application is IE dependent. Recently our client has installed IE 8 on his local machine, he tried to access our application and he was redirected to browser test page. This page will be displayed when the browser is not IE. But the fact is its IE.  Even i remember i got some issues and i though our application will work like that. but when my manager said its an issue, than we started to search for resolution. finally i we did the following changes and started working.... Open regedit use the tree menu and locate Post Platform. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\User Agent\Post Platform We renamed Post Platform to " Post Platform- " and its started working.