Archive for Aprile 23rd, 2008

Dump Type of Variable and Value

CodeKeep C# Feed Aprile 23rd, 2008

Description: Puts the type of variable and the contents in the debug stream

Link: http://www.codekeep.net/snippets/05df059a-3c01-4391-98ab-2889a8b0fba8.aspx

public String Dump(String Message, params object[] args)
        {
            String outMess = "";
            outMess += Message+"\n";
            foreach (object obj in args)
            {
                outMess += String.Format("{0} -> {1}\n",(obj.GetType()).ToString(),obj);
            }
            Debug.WriteLine(outMess);
            return outMess;
        }

Link to download

maurodx Aprile 23rd, 2008

Sorry but someone cannot find the download link to the demo client…

Go here: http://forex.isbeng.com/forexsignal

DataReader contains column.

CodeKeep C# Feed Aprile 23rd, 2008

Description: Gets if a sql datareader contains a column from a column-name.

Link: http://www.codekeep.net/snippets/0dbdfa7a-3bf3-467d-a699-63b9d35cd77b.aspx

/// <summary>
/// Gets if a sql datareader contains a column from a column-name.
/// </summary>
/// <param name="reader"></param>
/// <param name="columnName">The name of the column.</param>
/// <returns>True if the reader contains the column; otherwise false.</returns>
protected bool DataReaderColumnExists(System.Data.SqlClient.SqlDataReader reader, string columnName)
{
    if (reader == null)
    {
        return false;
    }

    string filter = string.Format("ColumnName='{0}'", columnName);
    System.Data.DataView dataView = reader.GetSchemaTable().DefaultView;
    dataView.RowFilter = filter;

    return dataView.Count > 0 ? true : false;
}

Customizing and Managing Your Site’s Appearance - Part 3

WebReference News Aprile 23rd, 2008

When a page that uses a master page (i.e. a content page) is requested, ASP.NET merges the content page and master page together (assuming both have been compiled) by inserting the master page’s content at the beginning of the content page’s control tree. This means that the master page content is actually a control added to the page. By Randy Connolly. 0421