Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi! friends,
i wants to show my data in label control using stored procedure method plz any one help me..
thanks in advance...
Posted
Comments
Prasad Khandekar 29-Jul-13 9:17am    
Hello Dev,

What all things have you tried so far. Please share your code in which you are having problems. Also please specify which database are you working with.

Regards,
Dev parmar 29-Jul-13 9:25am    
I work on MS SQL 2008 and i didn't try any because i not have any idea about it..
Asp_Learner 29-Jul-13 10:44am    
Do you know anything about www.google.com ?

1 solution

C#
//Your Connection Here

        SqlCommand comm = new SqlCommand();
        comm.Connection = ConnectionName;
        comm.CommandType = CommandType.StoredProcedure;
        comm.CommandText = "StoredProcedureName";
        
       
            SqlDataReader dr;

            dr = comm.ExecuteReader();
            if (dr.HasRows == true)
            {
                dr.Read();
                Label1.Text = dr["DataField"].ToString();
                
                dr.Close();
            }
 
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