Wednesday, April 7, 2010
Naming Conventions in SQL Server
• SQL Server variable names that start with the at sign (@),
• temporary tables and procedures that start with the number sign (#)
• global temporary tables and procedures that begin with the double number sign (##).
• Many built-in T-SQL functions and system variables have names that begin with a double at sign (@@),such as @@ERROR and @@IDENTITY.
Friday, March 19, 2010
Simple LINQ Examples
Linq command | output | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
“shashi” | shashi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"YES!!!".Dump ("Foreign |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
from n in new[] |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
from word in "The |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
var words = |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
123
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(new[] {"Tom", "Dick", "Harry"} |
|
What's New in SharePoint Server 2010?
What's New: Enterprise Content Management (ECM)
What's New: SharePoint Enterprise Search
What's New: PerformancePoint Services
What's New: Excel Services
What's New: User Profiles and Social Data
Word Automation Services Overview
http://msdn.microsoft.com/en-us/library/ee557323(office.14).aspx
// Detect if a string is numeric
public static bool IsNumeric(string text)
{
return Regex.IsMatch(text,"^\\d+$");
}
-----------------------
Protect string content by marshalling
// Protect string content by marshalling
IntPtr bstr = Marshal.SecureStringToBSTR(password);
try
{
// ...
// use the bstr
// ...
}
finally
{
Marshal.ZeroFreeBSTR(bstr);
}
Locate string on webpage
{
StreamReader SR;
WebResponse Resp ;
WebRequest MyWebRequest;
string PageStr;
MyWebRequest = WebRequest.Create(URL) ;
MyWebRequest.Timeout = 10000 ;
try
{
Resp = MyWebRequest.GetResponse() ;
SR = new StreamReader(Resp.GetResponseStream()) ;
PageStr = SR.ReadToEnd() ;
SR.Close() ;
PageStr = PageStr.ToUpper();
if ( PageStr.IndexOf(StrToLocate.ToUpper(), 0, PageStr.Length) != -1 )
return true;
else
return false;
}
catch ( WebException wex )
{
if (wex.Status == WebExceptionStatus.Timeout)
Response.Write("The request has timed out!") ;
else
Response.Write("There was some exception: " + wex.Message) ;
return false;
}
}