How to Call Stored Procedure

                SqlConnection conn = new SqlConnection("Data Source=*****;Initial Catalog=****User                           ID=**;Password=**;");
                SqlCommand cmd = new SqlCommand("NL_PremiumCalculation", conn);

                conn.Open();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@BP", Convert.ToDouble(BasicPremium));
                cmd.Parameters.AddWithValue("@PolicyType", policyType);
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataSet ds = new DataSet();
                da.Fill(ds, "Data");

Comments

Popular posts from this blog

Encrypt and Decrypt text using alphabet shifting method

Gridview to Datatable and Viewstate

You think Creating Circuler Graph is a difficult task ...........!!!