Not much nonsense, just on the way
1 Public StaticDataSet ExecuteDataset ( ThisIDbConnection CNN, IDbDataAdapter Adapter,stringSqlObjectparam =NULL,BOOLBuffered =true,int? CommandTimeout =NULL, CommandType? CommandType =NULL)2 {3 varDS =NewDataSet ();4 varCommand =NewCommanddefinition (SQL, (Object) param,NULL, CommandTimeout, CommandType, buffered?CommandFlags.Buffered:CommandFlags.None);5 varIdentity =NewIdentity (Command.commandtext, Command.commandtype, CNN,NULL, param = =NULL?NULL: Param. GetType (),NULL);6 varinfo =getcacheinfo (Identity, param, command. Addtocache);7 BOOLWasclosed = CNN. state = =connectionstate.closed;8 if(wasclosed) CNN. Open ();9Adapter. SelectCommand =command. SetupCommand (CNN, info.) Paramreader);Ten adapter. Fill (DS); One if(wasclosed) CNN. Close (); A returnds; -}
Add it below the Query method
Use Demo
var mysqlds = con. ExecuteDataset (New Mysqldataadapter (), "select * from wjf_role_relation where [email protected]_id", new {role_id = ' 1 '} );
A small extension of dapper to support datasets