Posted by Brad | Posted in Coding | Posted on 13-07-2011
Here are a couple of tips and tweaks that should make your visual studio 2010 experience less of a dragggggg..
Set your visual experience general environment options as follows, I have not noticed any real difference in the prettiness of the IDE but then I mainly develop console and asp.net applications
1) Uncheck Enable rich client visual experience
2) Check Use hardware graphics acceleration if available

Set your startup to an empty environment so the beast starts quicker without having to lookup a bunch of RSS feeds and have a think about what has been done recently so you can just get on with what you want to do.
If you have an active anti virus product on the computer find the advanced setting that enables you to exclude certain files/folders from runtime scanning in my case I exclude the following from my avast scanner.

Sure there are many other software options that can help but these are some easy ones that should make a big difference to your development experience.
Posted by Brad | Posted in Coding | Posted on 06-06-2011
Having my brain hammered by the latest asp.net mvc3, knockout.js, c#5 asynchronous web apps… and azure cloud deployment… was quite a fast paced day.



Posted by Brad | Posted in C# | Posted on 14-07-2010
With two controls on your asp.net page a DropDownList (ID ddlDropDownList) and a GridView (ID gvGridView), to retrieve the SelectedValue from the DropDownList and use that in the where clause of the query used to bind data to your GridView the following will help.
Required using statements
[codesyntax lang="csharp"]
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
[/codesyntax]
ADO.NET block of code to base your bind on using an SQLDataAdapter so you can still have paging on the GridView.
[codesyntax lang="csharp"]
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["CONNSTRINGNAME"].ConnectionString))
{
using (SqlCommand cmdGrid = new SqlCommand("SELECT * FROM TABLE WHERE FIELD = @PARAMETER", con))
{
cmdGrid.Parameters.AddWithValue("@PARAMETER", ddlDropDownList.SelectedValue);
con.Open();
using (SqlDataAdapter da = new SqlDataAdapter(cmdGrid))
{
DataTable dt = new DataTable();
da.Fill(dt);
gvGridView.DataSource = dt;
gvGridView.DataBind();
}
}
}
[/codesyntax]
The structure of the code is with using statments to ensure the garbage collection is carried out efficiently.