Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » How do I get PasswordHash value?
Closed Thread
Old 03-27-2009, 07:41 PM   #1 (permalink)
 
Junior Techie

Join Date: Nov 2008

Posts: 79

BobLewiston is on a distinguished road

Default How do I get PasswordHash value?

When I try to save a new (inserted) record via the following code:

Code:
DataRow row = dataTable.Rows [currRec]; 

// update data in DataSet from data entry WinForm  
row.BeginEdit (); 
row ["Title"] = txtTitle.Text; 
row ["FirstName"] = txtFirstName.Text; 
row ["MiddleName"] = txtMiddleName.Text; 
row ["LastName"] = txtLastName.Text; 
row ["Suffix"] = txtSuffix.Text; 
row ["Phone"] = txtPhone.Text; 
row ["EmailAddress"] = txtEmailAddress.Text; 
row.EndEdit (); 
  
try
{
    dataAdapter.Update (dataSet, "Person.Contact");
} 
catch (System.Runtime.InteropServices.ExternalException exc) 
{ 
    MessageBox.Show (exc.Message); 
}
I get the following exception message:

Quote:
Cannot insert the value NULL into column 'PasswordHash', table 'AdventureWorks.Person.Contact'; column does not allow nulls. INSERT fails. The statement has been terminated.
How do I get an appropriate PasswordHash value that I can put it in the newly-created record I'm inserting into the database?

For what it’s worth, the environment I’m working in is:

32-bit
SQL Server 2008 Express with Advanced Services
database:SQL2008 AdventureWorks (schema.table: Person.Contact)
SQL Server 2008 Management Studio Express
Visual C# 2008 Express
BobLewiston is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On