How do I get PasswordHash value?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BobLewiston
    New Member
    • Feb 2009
    • 93

    #1

    How do I get PasswordHash value?

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

    DataRow row = dataTable.Rows [currRec];

    // update data in DataSet from data entry WinForm
    row.BeginEdit ();
    row ["Title"] = txtTitle.Text;
    row ["FirstName"] = txtFirstName.Te xt;
    row ["MiddleName "] = txtMiddleName.T ext;
    row ["LastName"] = txtLastName.Tex t;
    row ["Suffix"] = txtSuffix.Text;
    row ["Phone"] = txtPhone.Text;
    row ["EmailAddre ss"] = txtEmailAddress .Text;
    row.EndEdit ();

    try
    {
    dataAdapter.Upd ate (dataSet, "Person.Contact ");
    }
    catch (System.Runtime .InteropService s.ExternalExcep tion exc)
    {
    MessageBox.Show (exc.Message);
    }

    I get the following exception message:

    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:SQL200 8 AdventureWorks (schema.table: Person.Contact)
    SQL Server 2008 Management Studio Express
    Visual C# 2008 Express
Working...