Showing posts with label generating. Show all posts
Showing posts with label generating. Show all posts

Monday, March 26, 2012

Suggestion for generating unique identifier.

Anyone have any suggestions for generating a unique identifier for a DB
column. I don't want to use an IDENTITY column because two seperate tables
will have PK columns that cannot have duplicate key values amongst the
tables. I thought about something to do with Date/Time. It can be any
datatype for that matter, it does not have to be an int type. I just need
something to uniquely identify records from two seperate tables.
Thanks
Marty UMarty U. <Marty U.@.discussions.microsoft.com> typed:
> Anyone have any suggestions for generating a unique identifier for a
> DB column. I don't want to use an IDENTITY column because two
> seperate tables will have PK columns that cannot have duplicate key
> values amongst the tables. I thought about something to do with
> Date/Time. It can be any datatype for that matter, it does not have
> to be an int type. I just need something to uniquely identify records
> from two seperate tables.
> Thanks
> Marty U
You could use a GUID. In C#:
string myGuid = Guid.NewGuid().ToString();
Davide Vernole
MVP ASP/ASP.NET
Microsoft Certified Solution Developer
GUID
SQL Server datatype "uniqueidentifier"
Greg
"Marty U." <Marty U.@.discussions.microsoft.com> wrote in message
news:D6C67BD9-3AA6-4125-9F4D-E16C63E94A89@.microsoft.com...
> Anyone have any suggestions for generating a unique identifier for a DB
> column. I don't want to use an IDENTITY column because two seperate tables
> will have PK columns that cannot have duplicate key values amongst the
> tables. I thought about something to do with Date/Time. It can be any
> datatype for that matter, it does not have to be an int type. I just need
> something to uniquely identify records from two seperate tables.
> Thanks
> Marty U
Marty U. wrote:
> Anyone have any suggestions for generating a unique identifier for a DB
> column. I don't want to use an IDENTITY column because two seperate tables
> will have PK columns that cannot have duplicate key values amongst the
> tables. I thought about something to do with Date/Time. It can be any
> datatype for that matter, it does not have to be an int type. I just need
> something to uniquely identify records from two seperate tables.
>
GUIDs are often used for that:
Guid id = Guid.NewGuid();
this corresponds to SQL Server's UniqueIdentifier type.
The SQL server can generate one using the NEWID() function - you can set
the column's default value to NEWID() to have the GUID generated
automatically for new records.
mikeb

Thursday, March 22, 2012

Support for generating random passwords in ASP.NET

Hi,
I am building web in ASP.NET using VB.NET to code the pages. I want to gene
rate random passwords for users. I know that password hashing is built right
into the .NET Framework. I was wondering if there is any built-in support f
or generating random passwo
rds in .Net. If the support is built-in, can you show me how to do it.
Thanks,
JoeThere is no random password functionality built into .NET.
But there is the Math.Random namespace that could easily help you string
together some random characters.
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:C6413BC5-1DF5-4C8D-ADC2-BCEB6BBAB5F8@.microsoft.com...
> Hi,
> I am building web in ASP.NET using VB.NET to code the pages. I want to
generate random passwords for users. I know that password hashing is built
right into the .NET Framework. I was wondering if there is any built-in
support for generating random passwords in .Net. If the support is
built-in, can you show me how to do it.
> Thanks,
> Joe
>
Joe
Try this.. http://www.4guysfromrolla.com/webte...t011100-1.shtml
It's ASP rather than .NET, but shouldn't take too much conversion.
HTH
Dan
"Joe" wrote:

> Hi,
> I am building web in ASP.NET using VB.NET to code the pages. I want to generate r
andom passwords for users. I know that password hashing is built right into the .NET
Framework. I was wondering if there is any built-in support for generating random p
ass
words in .Net. If the support is built-in, can you show me how to do it.
> Thanks,
> Joe
>

Support for generating random passwords in ASP.NET

Hi,

I am building web in ASP.NET using VB.NET to code the pages. I want to generate random passwords for users. I know that password hashing is built right into the .NET Framework. I was wondering if there is any built-in support for generating random passwords in .Net. If the support is built-in, can you show me how to do it.

Thanks,

JoeThere is no random password functionality built into .NET.
But there is the Math.Random namespace that could easily help you string
together some random characters.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:C6413BC5-1DF5-4C8D-ADC2-BCEB6BBAB5F8@.microsoft.com...
> Hi,
> I am building web in ASP.NET using VB.NET to code the pages. I want to
generate random passwords for users. I know that password hashing is built
right into the .NET Framework. I was wondering if there is any built-in
support for generating random passwords in .Net. If the support is
built-in, can you show me how to do it.
> Thanks,
> Joe
Joe

Try this.. http://www.4guysfromrolla.com/webte...t011100-1.shtml

It's ASP rather than .NET, but shouldn't take too much conversion.

HTH

Dan

"Joe" wrote:

> Hi,
> I am building web in ASP.NET using VB.NET to code the pages. I want to generate random passwords for users. I know that password hashing is built right into the .NET Framework. I was wondering if there is any built-in support for generating random passwords in .Net. If the support is built-in, can you show me how to do it.
> Thanks,
> Joe