Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am making retail shop website to take orders online. How can i add item in order book on click button(i.e. add button). When i click on add button item should add to cart for billing.
Posted
Updated 31-Dec-13 22:13pm
v2
Comments
Peter Leow 1-Jan-14 3:15am    
What have you tried?
Member 10279752 1-Jan-14 3:29am    
Yet not tried any methood.Plz tell how can i do??
Sergey Alexandrovich Kryukov 1-Jan-14 4:12am    
What have you tried so far?
What do you mean "how"? By doing some software engineering. Any particular concerns?
—SA
Member 10279752 1-Jan-14 4:19am    
Sir i just want complete my project.so using any easiest approach tell me..!!
Sergey Alexandrovich Kryukov 1-Jan-14 4:21am    
Sigh...

1 solution

"Okk Bt i wants to know sql queries for add items."

That's easy:
SQL
INSERT INTO MyTable (myColumn1, myColumn2) VALUES (MyValueForColumn1, MyValueForColumn2)

If you are using a coding language outside SQL, then you need to look at parameterized queries:
C#
using (SqlConnection con = new SqlConnection(strConnect))
    {
    con.Open();
    using (SqlCommand com = new SqlCommand("INSERT INTO myTable (myColumn1, myColumn2) VALUES (@C1, @C2)", con))
        {
        com.Parameters.AddWithValue("@C1", myValueForColumn1);
        com.Parameters.AddWithValue("@C2", myValueForColumn2);
        com.ExecuteNonQuery();
        }
    }</pre>
 
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