Monday, 16 January 2012

How to retrive multiple Records with Store Procedure Using Asp.Net

Question:- How to Retrieve Multiple Records with Store Procedure using Asp.Net
Answer:-
       using System.Data.SqlClient;

      string conn = "U R Connection";
        SqlConnection con = new SqlConnection(conn);
        SqlCommand cmd = new SqlCommand("Sp_name",con);
        cmd.CommandType = CommandType.StoredProcedure;
        SqlDataAdapter da = new SqlDataAdapter();
        da.SelectCommand = cmd;
         DataSet ds = new DataSet();
        da.Fill(ds);

No comments:

Post a Comment