Why could COM interop layer be 40 times slower when client is compiled in VS 2010 vs VS 2005?

It was kind of a long shot. Glad I could help. Matching MTA vs STA (threading model) is really important when making lots of distinct calls into any COM object. An [STAThread] directive at the top of a method is one way to be sure of threading model for every call in that method. Looks … Read more

Why does MSVC not issue a warning for signed/unsigned == comparison?

When comparing signed with unsigned, the compiler converts the signed value to unsigned. For equality, this doesn’t matter, -1 == (unsigned) -1. For other comparisons it matters, e.g. the following is true: -1 > 2U. EDIT: References: 5/9: (Expressions) Many binary operators that expect operands of arithmetic or enumeration type cause conversions and yield result … Read more

How to generate List from SQL query?

I think this is what you’re looking for. List<String> columnData = new List<String>(); using(SqlConnection connection = new SqlConnection(“conn_string”)) { connection.Open(); string query = “SELECT Column1 FROM Table1”; using(SqlCommand command = new SqlCommand(query, connection)) { using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { columnData.Add(reader.GetString(0)); } } } } Not tested, but this should work fine.

Why can’t I debug from Visual Studio 2005 after installing IE8?

A colleague of mine was having similar issues and found this: IE 8 has a feature called Loosely-Coupled Internet Explorer (LCIE) which results in IE running across multiple processes. http://www.microsoft.com/windows/internet-explorer/beta/readiness/developers-existing.aspx#lcie Older versions of the Visual Studio Debugger get confused by this and cannot figure out how to attach to the correct process. You can work … Read more

Create Project/solution in an existing directory?

From Visual Studio, if you have no solution open, you can select File->New->Project From Existing Code Select the project type Put the directory you want the solution and project file to be in as the “Project file location” field. Finish the wizard and you’ll have a project file and solution file in the same directory. … Read more

tech