.Net Tips & Tricks
This is the method for showing the Header of GridView when no data returned in the query.
DataTable dt = new DataTable();
_conn = new DbConnection();
dt = _conn.ExecuteSelectQueryNoParam("select * from test");
if (dt.Rows.Count == 0)
{
DataRow dr = dt.NewRow();
dt.Rows.Add(dr);
}
GridView1.DataSource = dt;
GridView1.DataBind();
GridView1.Rows[0].Visible = false;
To check the version of. NET Framework you can use the following command:
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(".NET Framework Version: " + System.Environment.Version.ToString());
}
Or check in the Registry by following the path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
To get version SQL Server in use, you use command query below:
SELECT @@VERSION
The results of the query:
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft Corporation Developer Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
I have tested this command on SQL Server 2005 & 2008.
Features
Merge all text files into one file.
Download current version (1.0)
You will be prompted to choose a location on your computer to save the file to.
Here is a url address list I normally use:
Response.Write("<b>Request.ApplicationPath:</b> " + Request.ApplicationPath);
Response.Write("<br />");
Response.Write("<b>Request.CurrentExecutionFilePath:</b> " + Request.CurrentExecutionFilePath);
Response.Write("<br />");
Response.Write("<b>Request.FilePath:</b> " + Request.FilePath);
Response.Write("<br />");
Response.Write("<b>Request.Path:</b> " + Request.Path);
Response.Write("<br />");
Response.Write("<b>Request.PhysicalApplicationPath:</b> " + Request.PhysicalApplicationPath);
Response.Write("<br />");
Response.Write("<b>Request.QueryString:</b> " + Request.QueryString);
Response.Write("<br />");
Response.Write("<b>Request.Url.AbsolutePath:</b> " + Request.Url.AbsolutePath);
Response.Write("<br />");
Response.Write("<b>Request.Url.AbsoluteUri:</b> " + Request.Url.AbsoluteUri);
Response.Write("<br />");
Response.Write("<b>Request.Url.Host:</b> " + Request.Url.Host);
Response.Write("<br />");
Response.Write("<b>Request.Url.Authority:</b> " + Request.Url.Authority);
Response.Write("<br />");
Response.Write("<b>Request.Url.LocalPath:</b> " + Request.Url.LocalPath);
Response.Write("<br />");
Response.Write("<b>Request.Url.PathAndQuery:</b> " + Request.Url.PathAndQuery);
Response.Write("<br />");
Response.Write("<b>Request.Url.Port:</b> " + Request.Url.Port);
Response.Write("<br />");
Response.Write("<b>Request.Url.Query:</b> " + Request.Url.Query);
Response.Write("<br />");
Response.Write("<b>Request.Url.Scheme:</b> " + Request.Url.Scheme);