Cast to int on SqlCommand-ExecuteScalar error handling?

I have code that is possibly fragile. This statement here int countDis = (int)cmd.ExecuteScalar(); If I change t...

Difference between Initial Catalog and Database keyword in connection string?

What is the main difference between Initial Catalog and Database Keyword in a connection string? ...

What does strongly typed means in .NET framework??

This morning was going through a book where I found a paragraph as stated below : Each data field in a table is a s...

Convert DataSet to List?

Here is my c# code Employee objEmp = new Employee(); List<Employee> empList = new List<Employee>(); for...

Insert into C# with SQLCommand?

What's the best way to INSERT data into a database? This is what I have but it's wrong.. cmd.CommandText = "INSERT...