Realized certain video files were not showing up even after going to File Management and Synching the folders. The dnn site you to set the acceptable file types.
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
So I had a problem where one of the companies we work with wanted data for a column, however they wanted a single example. However in our system we can have multiple entries for that column. I needed to get a single example other wise when joining would show other many more rows than necessary for what they wanted. SO I turned to Common Table Expressions (CTE)s. Although turned out that because I was excluding data one of my bosses said just not to send that field, because it would be similar to misinformation. Hah. ;With PBs(accountID,PBName,rn) AS ( select ACV.accountID, B.lastName + ', ' + B.firstName + ' ' + B.middleInit, ROW_NUMBER() OVER (PARTITION BY acv.accountID ORDER BY acv.accountID DESC) as rn FROM ACV --- etc joins where --conditions group by ACV.accountID, B.lastName + ', ' + B.firstName + ' ' + B.middleInit ) SELECT --other fields PB.PBName FROM ACV ---joins LEFT OUTER JOIN PBs...
Select from the sqldatasource and convert the output to a dataview, then place the same filter you are using, and get the count. Remember to place this code in the databound event. protected void gvCurLookup_DataBound(Object sender, System.EventArgs e) { System.Data.DataView dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty); dv.RowFilter = SqlDataSource1.FilterExpression; int RowCount = dv.Count; if (dv.Count > 0) { this.lblMsg.Text = dv.Count + " Books..."; } } ref http://www.c-sharpcorner.com/UploadFile/scottlysle/using-filter-expressions-with-an-sql-data-source-in-Asp-Net-C-Sharp/
Comments
Post a Comment