Total Pageviews
Wednesday, July 1, 2009
True Random and Unique AlphaNumeric Number Generator
Forums for Microsoft .NET developers
Hi begginers to Microsoft.NET world, here a list of forums and educational sites where you can post your queries and get ur answers from professionals. this may help you to increase your knowledge and also help if u stuck with some issues…become a regular member(its free) so that source code access is easy ….and also contibute wen u have enough greymatter to solve complex issues of .NET. Comment on this post and add more forums which i might have missed …..
www.w3schools.comTuesday, June 30, 2009
Find out the Binary, ASCII and Character of a Given String in SQL Server
When you are storing data inside fields like ‘address’, there are bound to be unusual characters in it which make way due to poor validation rules. A good way to look for them is to convert your string to varbinary.
Here’s the query:
DECLARE @MyAddress varchar(35) SET @MyAddress = 'CANTB RY EA%T P.O.Box 55343' DECLARE @BIN AS VARBINARY(100) SET @BIN = convert(varbinary(100),@MyAddress) SELECT SUBSTRING(@BIN, Number, 1) AS Binary, ASCII(SUBSTRING(@BIN, Number, 1)) AS ASCII, CHAR(ASCII(SUBSTRING(@BIN, Number, 1))) AS Character FROM master..spt_values WHERE Type = 'p' AND Number BETWEEN 1 AND DATALENGTH(@BIN)
Monday, June 29, 2009
Using JavaScript for Validation of Different Date Formats in Asp.NET Web Form
22 Visual Studio Short Keys and 6 Short-cut Ways to Custom Jobs: A List of Tips and Tric
Friday, June 26, 2009
How to detect browser using JavaScript
Thursday, June 25, 2009
Generating Unique Keys in .Net
Using DateTime and HashCode:
So then I tried
Guid.NewGuid().ToString().GetHashCode().ToString(”x”);
private string GetUniqueKey()
{
int maxSize = 8;
int minSize = 5;
char[] chars = new char[62];
string a;
a = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
chars = a.ToCharArray();
int size = maxSize;
byte[] data = new byte[1];
RNGCryptoServiceProvider crypto = new RNGCryptoServiceProvider();
crypto.GetNonZeroBytes(data);
size = maxSize;
data = new byte[size];
crypto.GetNonZeroBytes(data);
StringBuilder result = new StringBuilder(size);
foreach (byte b in data)
{
result.Append(chars[b % (chars.Length - 1)]);
}
return result.ToString();
}
Analysis shows that RNGCrypto with Character Masking is best method to generate Unique keys.
Blog Archive
Ideal SQL Query For Handling Error & Transcation in MS SQL
BEGIN TRY BEGIN TRAN --put queries here COMMIT; END TRY BEGIN CATCH IF @@TRANCOUNT>0 BEGIN SELECT @@ERROR,ERRO...
-
All we need to use the Custom paging in grid view without object data source. Here i am going to explain my code which is used in custom pa...
-
One of the common requests in ASP.NET is to submit a form when visitor hits an Enter key. That could be a case if, for example you want to m...
-
using System.Data; using System.Data.SqlClient; using System.Text; using System.IO; using iTextSharp.text; using iTextSharp.text.pdf; ...