Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <connectionStrings>
  2. <add name="connectionStringName"
  3. connectionString="Data Source=NAMESQLEXPRESS;Initial Catalog=DbName;Integrated Security=True"
  4. providerName="System.Data.SqlClient" />
  5.  
  6. SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionStringName"].ConnectionString);
  7. SqlCommand cmd;
  8. con.Open();
  9. cmd = new SqlCommand("proc_name", con);
  10. cmd.CommandType = CommandType.StoredProcedure;
  11. cmd.Parameters.Add(new SqlParameter("@id", id));
  12. cmd.ExecuteReader();
  13. con.Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement