Please help how to do it

Posted by Amulya under C# on 3/23/2013 | Points: 10 | Views : 787 | Status : [Member] | Replies : 3
Create a console application. You should get the following information from the user
o First name
o lastname
o email
o password
o confirm
o address1
o city
o stateprovince
o zipcode
o dayphone
Step 2 :
Run the create-customer.sql available in this folder to create the customer table to store this information.
Step 3
Run the Create-sp_addCustomer.sql to create the stored procedure sp_addCustomer that adds a new customer's details to the customers table.
Step 4.Give an option to add a customer,on selecting the option run the sp_addCustomer passing the required parameters
4a.Start with creating SqlConnection, passing the appropriate connection string.
4b.Create a new SqlCommand object, passing the name of the stored procedure to be called as a string.
4c. Set the command type of the command object to Stored Procedure
4d.Using the parameters collection of the command object add a parameter for each parameter you need to pass from the sign up form.
4e. Now fill in the @customer_id output parameter.Create a SqlParameter and initialize it with string "@customer_id" and a type of SqlDbType.Int.Set the direction of the parameter to ParameterDirection.Output. Finally add this parameter to the command.
4f.Now open the connection and execute the stored procedure by calling the cmd object's ExecuteNonQuery () method.Dont forget to handle exceptions and close connection safely
4g.Check the output parameter customer_id and display the following: You are successfully signed. Please note your customer id is <..> for future reference.




Responses

Posted by: Jayakumars on: 3/23/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

post your Code.

Mark as Answer if its helpful to you

Amulya, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amulya on: 3/23/2013 [Member] Starter | Points: 25

Up
0
Down
Dear sir,

Iam new to dotnet.This is a Assignment given to me.How to start?

Thanks

Amulya, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 3/23/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

refer this console application
http://www.programcall.com/2/csnet/what-is-console-application.aspx

sql query like this

Create Table Test1
as
First name varchar(20),
lastname varchar(20),
email varchar(20),
password varchar(20),
confirm varchar(20),
address1 varchar(20),
city varchar(20),
stateprovince varchar(20),
zipcode varchar(20),
dayphone varchar(20)

Mark as Answer if its helpful to you

Amulya, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response