Able to access Database without opening connection, using Dapper

So I have the following piece of code that is showing a strange behavior or I am missing some point here: public async Task<IEnumerable<MyData>> GetMyData() { MySqlConnection conn; IEnumerable<MyData> list; string querystring = "SELECT * FROM tbl_mydata;"; using (conn = new MySqlConnection(mydbconnectionString)) { //conn.Open(); ConnectionState check1 = conn.State; list = await conn.QueryAsync<MyData>(querystring, commandType: CommandType.Text); ConnectionState … Read more

How to use autoMapper for datatables to list?

I think I miss something in my code which cause this error : AutoMapperMappingException: Missing type map configuration or unsupported mapping. this is my first time that I try to use autoMapper for filling my dto from datatable. so I found an example from How do I use automapper to map a dataset with multiple tables . so this is my code :

entity object cannot be referenced by multiple instances of IEntityChangeTracker. while adding related objects to entity in Entity Framework 4.1

I am trying to save Employee details, which has references with City. But everytime I try to save my contact, which is validated I get the exception “ADO.Net Entity Framework An entity object cannot be referenced by multiple instances of IEntityChangeTracker”

What’s better: DataSet or DataReader?

I just saw this topic: Datatable vs Dataset
but it didn’t solve my doubt .. Let me explain better, I was doing connection with database and needed to show the results in a GridView. (I used RecordSet when I worked with VB6 while ago and DataSet is pretty similar to it so was much easier to use DataSet.)
Then a guy told me DataSet wasn’t the best method to do ..