SQL PasswordHash NULL problem - Microsoft SQL Server
This is a discussion on SQL PasswordHash NULL problem - Microsoft SQL Server ; I’m learning SQL. I’m accessing database SQL2008 AdventureWorks, table Person.Contact, which has a column PasswordHash, of type varchar (128). Here’s the code I’m using to save records: Code: // here dataTable and dataSet have been declared at the class-wide level ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| Code: // here dataTable and dataSet have been declared at the class-wide level as
// private DataTable dataTable;
// private DataSet dataSet;
DataRow row = dataTable.Rows [currRec];
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 + "\n\n" + currRec + "\n\"" +
dataSet.Tables ["Person.Contact"].Rows [currRec] ["PasswordHash"].ToString () + "\"",
"System.Runtime.InteropServices.ExternalException");
}
catch (Exception exc) { MessageBox.Show (exc.Message, "Exception"); }
try { dataSet.AcceptChanges (); }
catch (Exception exc) { MessageBox.Show (exc.Message, "dataSet.AcceptChanges ();"); }
Code: row ["PasswordHash"] = "GylyRwiKnyNPKbC1r4FSqA5YN9shIgsNik5ADyqStZc="; Quote:
Code: dataSet.AcceptChanges (); Using SQL Server 2008 Management Studio Express, I can find no property of column PasswordHash that would account for this. Can anybody tell me what’s going on here? Next question (for when I have the above issue resolved): although "GylyRwiKnyNPKbC1r4FSqA5YN9shIgsNik5ADyqStZc=" is a real PasswordHash that I lifted from an already existing record (see above), I don’t really know if I can just plunk it into a new record. I found a code snippet to generate a PasswordHash, but it appears to need the password itself to create the PasswordHash. I don’t know why an individual column within an individual table would need an individual password, so I guess what’s needed is the password for the entire database. But my database doesn’t have a password; since the database is resident on my computer and I’m the only user, I just use Windows Authentication. Does anyone know what I should do? Or maybe I can just put anything in this column? Or perhaps I can make SQL Server Management Studio allow NULL in the PasswordHash column. I discovered this would be possible in SQL Server Management Studio via: expand table | expand Columns | right-click PasswordHash column | click Modify | in lower right frame: toggle Allow Nulls from No to Yes On doing so and then attempting to exit SQL Server Management Studio, I got a dialog box saying: Quote:
Quote:
Tools | Options | Designers | Table and Database Designers | Prevent saving changes that require table re-creation I can try this, but I wonder if it might be dangerous. If for whatever reason the table can't be re-created, could I possibly destroy the original table in the process and then have to reinstall the AdventureWorks database? I don't want to have to do that, since for some unknown reason I had a very difficult time installing it the first time. And besides, I want to have the option to implement encryption later, and I suspect I might not be able to if I allowed PasswordHash to be NULL. (Anybody know if that’s true?) Also, I have been warned that if I do this I might “break something”. I don’t see how this would affect the relationships between tables. Any opinions? For what it's worth, I'm working in a 32-bit environment with the following software: SQL Server 2008 Express with Advanced Services database: SQL2008 AdventureWorks (schema.table: Person.Contact) SQL Server 2008 Management Studio Express Visual C# 2008 Express |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 06:51 PM.




Linear Mode