using System;
using System.Data;
using System.Data.SqlClient;
public class AddCustomer
{
public static void Main()
{
string connectionString = "Data Source=localhost;Initial Catalog=store;Integrated Security=SSPI";
string procedure = "CustomerAdd";
SqlConnection con = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand(procedure, con);
cmd.CommandType = CommandType.StoredProcedure;
con.Open();
SqlCommandBuilder.DeriveParameters(cmd);
cmd.Parameters[1].Value = "name";
cmd.Parameters[2].Value = "j@m.com";
cmd.Parameters[3].Value = "password";
cmd.Parameters[4].Value = DBNull.Value;
cmd.ExecuteNonQuery();
con.Close();
Console.WriteLine("New ID: " +cmd.Parameters[4].Value);
}
}