Generate auto increment linear no in asp.net c#

Posted by Raja_89 under C# on 1/5/2013 | Points: 10 | Views : 1769 | Status : [Member] | Replies : 2
Hai Techies

Kindly guide me
1.How to generate a auto increment linear integer no in asp.net .

2. In which datatype should image can be saved in sql server either image,nvarchar or else and if you some explanation for that i will happy for that.



Regards




Responses

Posted by: Shubham on: 1/7/2013 [Member] Starter | Points: 25

Up
0
Down
Hi!!!! Raja

this will show u linear no

using System;

class Linteger
{
static void Main()
{
// show binary string for 100.
Console.WriteLine(GetIntBinaryString(100));

// show binary string for 100000.
Console.WriteLine(GetIntBinaryString(100000));
}

static string GetIntBinaryString(int n)
{
char[] b = new char[32];
int pos = 31;
int i = 0;

while (i < 32)
{
if ((n & (1 << i)) != 0)
{
b[pos] = '1';
}
else
{
b[pos] = '0';
}
pos--;
i++;
}
return new string(b);
}
}





Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shubham on: 1/7/2013 [Member] Starter | Points: 25

Up
0
Down
raja you will save image in database in binary format
convert image in binary format and save in database and retrieve convert binary to image ......

Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response