By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,806 Members | 1,829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,806 IT Pros & Developers. It's quick & easy.

How do I get PasswordHash value?

P: 93
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.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:

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
Mar 27 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.