Posts

Showing posts from May, 2014

T-SQL - Joining Out To Only One Row

This is an experpt of a larger select, but it shows the important section of how to only get back one row. http://www.bennadel.com/blog/1093-getting-one-record-per-group-from-a-one-to-many-join.htm LEFT OUTER JOIN  dbo.ClientAddressBridge AS CAB on c.ID= CAB.clientID AND   CAB.[status]=1 AND         CAB.ID =                (Select Top 1             ClientAddressBridge2.ID             From                 ClientAddressBridge as ClientAddressBridge2             where ClientAddressBridge2.clientID  =c.id)         

Debug Side Effects With StreamReader

Image
Say you get the response stream, and you want to see what the value is in the Watch.     Dim resp As HttpWebResponse = DirectCast(req.GetResponse(), HttpWebResponse)     Dim sr As New System.IO.StreamReader(resp.GetResponseStream())     Return sr.ReadToEnd() You click the little refresh button you can evaluate the stream and view the response.  However, when the stream returns the object it will be string.empty.  Visual Studio 2012 does warn you about it having side-effects, but I did not think it would be to this extent.  I would think it would reset the stream to the previous state when continuing, but it does not.  Odd.

Automate 9 - Loop Through Files Delete Old Files

Image
Automate 9 -  Looping Through files and deleting ones older than a certain number of days days.

Vb.NET Writing HTTPWebRequest String Timeout

'req is type HTTPWebRequest The code below fails to work.  ATM I do not know why, but it simply times out. I am thinking that the object is not being properly disposed of. req.GetRequestStream().Write(reqBody, 0, reqBody.Length)  Use the following below instead.         Using inputStream = req.GetRequestStream()             inputStream.Write(reqBody, 0, reqBody.Length)         End Using

Crystal Reports Slowdown

The Crystal Reports Program was encountering some serious slowdowns. I narrowed it down to having the grid option on.  To toggle option find in the menu,  View -> Grid->Preview.

Crystal Reports Notes

Image
Crystal Reports: Notes 1. Can Grow (right click on a field in report and click Format Field) 2.  Able to group based on a field per page, and then change them. Right click on Group header on the left side, then select Change Group.   To create a group on the top menu -> Insert -> Group. 3. Can change style of fields.  For instance you can select to commas, or select as currency. 4. Can use a stored procedure as a source. 5. Formula fields are fields that use a field from the source, but with additional optional coded logic. 6. Parameter Fields - equivalent to the input parameters necessary for the sp. 7. Preview - Input value and then see the report with actual values from db. 8. Possible to have inner groups.  Then have outer group be the summary.