Remember hidden original values in a gridviewJuly 4, 2007 9:07
To solve this issue you have to set and extra property and you have to supply some code to the Rowupdating event of the gridview. The property you have to set with the field names that you are not using is the DataKeyNames property of the gridview. For example:
DataKeyNames=”UniqueId,VersionId”
Now you can add the missing information to the OldValues and NewValues collection in the RowUpdating event.
Protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{ IDictionaryEnumerator restoreOldValues = e.Keys.GetEnumerator(); while (restoreOldValues.MoveNext()) { e.OldValues.Add(restoreOldValues.Key.ToString(), restoreOldValues.Value.ToString()); e.NewValues.Add(restoreOldValues.Key.ToString(), restoreOldValues.Value.ToString()); } } The gridview now has all the required information to run a successful update. Tags: .NET, database, DataKeyNames, field names, optimistic concurrency, RowUpdating.Troubleshoot disconnected SQL Server usersJuly 3, 2007 12:15
The exported database will contain your users, but they are no longer connected to valid SQL Server logins. Even if the same users are existing on the new SQL Server, their ID’s might be different. One of the options is to just recreate and configure the users, but sometimes this is not an option; You might have a lot of users or complicated user rights that you don’t want to check, test and document. SQL Server contains stored procedure in the Master database to connect your database users with the available SQL Server users. This stored procedure is called “sp_change_users_login”. Just take the steps below to attach your users:
Narayana Vyas Kondreddi has written more detailed information about this subject at his website which contains a handy stored procedure “ShowOrphanUsers” which provides you with a list of all unconnected users. Documentation about the “sp_change_users_login” stored procedure can be found at the MSDN website. Tags: database users, disconnected, login problems, logins, security, SQL_Server, stored procedure, users. |
||