Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. store procedure

store procedure

Scheduled Pinned Locked Moved C#
tutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    daku1
    wrote on last edited by
    #1

    how to call storeprocedure in page load event i have string strCmd = "exec rpt_OnlineStoreActivity '01/01/2000', '07/30/2007'"; can some if this is wirght away to do it. thank you

    T 1 Reply Last reply
    0
    • D daku1

      how to call storeprocedure in page load event i have string strCmd = "exec rpt_OnlineStoreActivity '01/01/2000', '07/30/2007'"; can some if this is wirght away to do it. thank you

      T Offline
      T Offline
      T EDY
      wrote on last edited by
      #2

      may i see u'r stored procedure code? if u use stored procedure for the query,next thing u must do is call stored procedure..or i'm missing something about your question? for example on page load events i write this code:

      string Connection = ConfigurationManager.ConnectionStrings["Connect"].ConnectionString;
      SqlConnection conn = new SqlConnection (Connection);
      conn.Open();
      SqlCommand cmd = new SqlCommand("sp_SelectAllData", conn);
      cmd.CommandType = CommandType.StoredProcedure;
      SqlDataAdapter da = new SqlDataAdapter(cmd);
      DataTable dt = new DataTable();
      da.Fill(dt);
      return dt;
      

      note : i already have a stored procedure name sp_SelectAllData in my database but try using Data Access Layer, Bussiness Logic..so if u want some change in u'r interface u don't have much trouble to change your code Kind Regards, Tomi

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups