It is not often when I have to go and create a DataGridView in Winforms so here are some notes. Sadly we are stuck in .net 2.0. I find it easier to add the columns manually through the designer that the datagridview will hold. Ids, text fields, buttons, etc. I have a custom CalendarColumn as well. The main fields of the columns in the dgv that are used are the HeaderText, Visible, DefaultCellStyle->Format, DataPropertyName, Name, AutoSizeMode, and Width. In case of Button UseColumnTextForButtonValue (remember to have the FlatStyle = Standard). When accessing data, the values could be nothing or DBNull.value, depending if it is a new row or not. So will need a lot of testing for DBNull or Nothing. Adding data to dgv could be done inside the dgv, but having fields outside to add to the grid is feasible as well. Modifing inside or outside grid can work. Deleting seems to work well inside. Rebinding works well after a changing...
So you can remotely connect to the server and see the restored database but when you click to expand it and view the tables it throws an error. An error like not available in security context or such other such helpful information. The problem in my case is that the user existed, and it had all the proper security. I ran the change users proc on the user...or so I thought. Actually on the upper left somehow the database selected was master. Good thing for co workers that can point out my mistake. So, my fault I guess, although these orphaned users are strange... EXEC sp_change_users_login 'Auto_Fix', ' user ' http://dbadiaries.com/using-sp_change_users_login-to-fix-sql-server-orphaned-users
Came in to a nice DNN error - Connection to the Database Failed when trying to run the website. In my case I had some stray text in the web.config that was not xml. Once I commented it out the site ran properly.
Comments
Post a Comment