【问题标题】:Use cookie in SQL where statement在 SQL where 语句中使用 cookie
【发布时间】:2014-04-17 20:20:22
【问题描述】:

在 Visual Studio 中使用 c# 有谁知道如何在另一个页面上的 sql where 语句中使用一个页面中的 cookie。我正在尝试根据某些列中的某些值以网格形式从数据库中提取信息。人们从存储 cookie 的页面搜索电影院列表。就像从[FilmName] = "CookieValue" 的电影中选择一样。 谢谢 SQL " SelectCommand="从 [CinemaListings] 中选择 [电影名称]、[日期]、[时间]、[预订]"> 我想在 where 子句中使用的 Cookie 形成另一个页面,该页面使用上面显示的代码指向页面
protected void btnsubmit_Click(对象发送者,EventArgs e) { Response.Cookies["SelectedConty"].Value = CountyDrop.SelectedItem.Text; Response.Cookies["SelectedFilm"].Value = FilmDrop.SelectedItem.Text; Response.Cookies["SelectedCinema"].Value = CinemaDrop.SelectedItem.Text; //Response.Write(Response.Cookies["SelectedConty"].Value); Response.Redirect("CinemaListings2.aspx"); }

【问题讨论】:

    标签: sql visual-studio-2010


    【解决方案1】:

    您不能直接从数据库访问 cookie,但是您可以简单地从您的 Web 服务器页面读取值(假设您有一个)并将其传递。如果您没有服务器网页/处理程序/控制器等。那么您就不走运了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-16
      • 2017-01-27
      • 1970-01-01
      • 2018-07-23
      • 1970-01-01
      • 2021-11-12
      • 1970-01-01
      相关资源
      最近更新 更多