Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
HI am newer to stored procedure kindly pls do me a favour i have an data with two rows in an table now i need to retrive the specific column value into textbox i have writen my code in sp n got op nw i need to retrive that to text box pls help me..here is my code i have tested...


C#
cmd = new SqlCommand("faults", con);
       cmd.CommandType = CommandType.StoredProcedure;
 cmd.Parameters.Add(new SqlParameter("@TextBox1", System.Data.SqlDbType.Int));
         dr = cmd.ExecuteReader();
       while (dr.Read())
       {
           TextBox1.Text = dr[0].ToString();
           TextBox2.Text = dr[1].ToString();


       }
       dr.Dispose();
       cmd.Dispose();

My error 
Procedure faults has no parameters and arguments were supplied.


Help me pls

Thank You...
Posted
Comments
Asp_Learner 6-Aug-13 9:55am    
post your store procedure.

before going into solution you definately need to learn about parameter parsing this may help you

https://www.google.co.in/search?q=Stored+Procedure+in+Asp+.net+c%23&oq=Stored+Procedure+in+Asp+.net+c%23&aqs=chrome.0.69i57&sourceid=chrome&ie=UTF-8[^]

first learn this you will definitely find solution your self

regards...:)
 
Share this answer
 
Hi,

You posted your error
SQL
My error
Procedure faults has no parameters and arguments were supplied.


This error indicate that your procedure "faults" does not have any parameter.
Please check your sp.
 
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