Click here to Skip to main content
15,886,802 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i m fresh in asp.net so plz writ ur answer in breaf
FARHAT ULLH
Posted
Updated 1-Jul-15 21:08pm
v2

C#
using (SqlConnection con = new SqlConnection(strConnect))
    {
    con.Open();
    using (SqlCommand com = new SqlCommand("MyStoredProcedureName", con))
        {
        com.CommandType = CommandType.StoredProcedure;
        SqlParameter name = new SqlParameter("@Name", SqlDbType.VarChar, 100);
        name.Direction = ParameterDirection.Output;
        com.Parameters.Add(name);
        com.Parameters.AddWithValue("@SearchForID", 12345);
        com.ExecuteNonQuery();
        string r = (string) name.Value;
        string s = (string) com.Parameters["@Name"].Value;
        }
    con.Close();
    }

Calls an SP which takes an ID value as a parameter, and returns the username as another parameter.
 
Share this answer
 
Don't forget google is your friend . a tons of articles available online. Check
Link1
Link2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900