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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How I can pass session parameters to SqlDataSource

How I can pass session parameters to SqlDataSource

Scheduled Pinned Locked Moved Database
sysadmintutorial
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.
  • M Offline
    M Offline
    msomar
    wrote on last edited by
    #1

    hi.. How I can Pass session parameters to sqlDataSource. I do like this but it is not work:

    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:AdNetConnectionString %>"

            SelectCommand="SELECT CampaignName, AdType AS \[Campaign Type\], Status, Date AS \[Start Date\], Clicks, Impr, DailyBudget AS \[Daily budget\] FROM Account INNER JOIN AdCampaign ON Account.ID = AdCampaign.AccountID WHERE Account.EmailAddress = @EmailAddress  ">
            <SelectParameters>
            <asp:SessionParameter Name="EmailAddress" Type="String"  SessionField="EmailAddress" />
            </SelectParameters>
            </asp:SqlDataSource>
    

    The session name is :session["EmailAddress"] Please guide me.

    M 1 Reply Last reply
    0
    • M msomar

      hi.. How I can Pass session parameters to sqlDataSource. I do like this but it is not work:

      <asp:SqlDataSource ID="SqlDataSource1" runat="server"
      ConnectionString="<%$ ConnectionStrings:AdNetConnectionString %>"

              SelectCommand="SELECT CampaignName, AdType AS \[Campaign Type\], Status, Date AS \[Start Date\], Clicks, Impr, DailyBudget AS \[Daily budget\] FROM Account INNER JOIN AdCampaign ON Account.ID = AdCampaign.AccountID WHERE Account.EmailAddress = @EmailAddress  ">
              <SelectParameters>
              <asp:SessionParameter Name="EmailAddress" Type="String"  SessionField="EmailAddress" />
              </SelectParameters>
              </asp:SqlDataSource>
      

      The session name is :session["EmailAddress"] Please guide me.

      M Offline
      M Offline
      Michel Godfroid
      wrote on last edited by
      #2

      Add the risk of sounding repetitious and single-minded: And what is the error message? There are no psychics here.

      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