Search Results

Search found 52 results on 3 pages for 'haseeb anwar'.

Page 3/3 | < Previous Page | 1 2 3 

  • Unable to use stored procs in a generic repository for the entity framework. (ASP.NET MVC 2)

    - by Matt
    Hi, I have a generic repository that uses the entity framework to manipulate the database. The original code is credited to Morshed Anwar's post on CodeProject. I've taken his code and modified is slightly to fit my needs. Unfortunately I'm unable to call an Imported Function because the function is only recognized for my specific instance of the entity framework public class Repository<E, C> : IRepository<E, C>, IDisposable where E : EntityObject where C : ObjectContext { private readonly C _ctx; public ObjectResult<MyObject> CallFunction() { // This does not work because "CallSomeImportedFunction" only works on // My object. I also cannot cast it (TrackItDBEntities)_ctx.CallSomeImportedFunction(); // Not really sure why though... but either way that kind of ruins the genericness off it. return _ctx.CallSomeImportedFunction(); } } Anyone know how I can make this work with the repository I already have? Or does anyone know a generic way of calling stored procedures with entity framework? Thanks, Matt

    Read the article

  • how do i search from php file ?

    - by Tum Bin
    Dear Friends, im totally new in php. Just learning. I got 2 Assingment with php and html. Assignment 01: I have to mansion some pplz name and all of them some friends name. and I have to print common friend if there have common friend. Bt there have a prob that I got also msg which dnt have any common friend like “Rana has 0 friends in common with Roni.” I want to stop this and how can i? Assignment 02: I made a html form to search a person from that php file. Like: when I will search for Rana php form will b open and and print : Rana have 4 friends and he has a common friend with Nandini and Mamun. when I will search for Tanmoy the page will be open and print: Tonmoy is Rana’s friend who have 4 friend and common friends with Nandini and Mamun. for this I have to use the function “post/get/request” Plz plz plzzzzzzzzzz help me! Here im posting my codes; <?php # Function: finfCommon function findCommon($current, $arr) { $cUser = $arr[$current]; unset($arr[$current]); foreach ($arr As $user => $friends) { $common = array(); $total = array(); foreach ($friends As $friend) { if (in_array($friend, $cUser)) { $common[] = $friend; } } $total = count($common); $add = ($total != 1) ? 's' : ''; $final[] = "<i>{$current} has {$total} friend{$add} in common with {$user}.</i>"; } return implode('<br />', $final); } # Array of users and friends $Friends = array( "Rana" => array("Pothik", "Zaman", "Tanmoy", "Ishita"), "Nandini" => array("Bonna", "Shakib", "Kamal", "Minhaj", "Ishita"), "Roni" => array("Akbar", "Anwar", "Khakan", "Pavel"), "Liton" => array("Mahadi", "Pavel"), "Mamun" => array("Meheli", "Tarek", "Zaman") ); # Creating the output value $output = "<ul>"; foreach ($Friends As $user => $friends) { $total = count($friends); $common = findCommon($user, $Friends); $output .= "<li><u>{$user} has {$total} friends.</u><br /><strong>Friends:</strong>"; if (is_array($friends) && !empty($friends[0])) { $output .= "<ul>"; foreach ($friends As $friend) { $output .= "<li>{$friend}</li>"; } $output .= "</ul>"; } $output .= "{$common}<br /><br /></li>"; } $output .= "</ul>"; # Printing the output value print $output; ?>

    Read the article

< Previous Page | 1 2 3