>  기사  >  웹 프론트엔드  >  GridView(asp.net)_jquery에 표시할 Jquery ajax 요청 데이터

GridView(asp.net)_jquery에 표시할 Jquery ajax 요청 데이터

WBOY
WBOY원래의
2016-05-16 18:20:391100검색

AJAXLoadProgressForm.aspx:

复代码 代码如下:













GetGridViewByConditionForm.aspx:
复代码 代码如下:

protected void Page_Load(개체 보낸 사람, EventArgs e)
{
if (Request["id"] != null)
{
SqlConnection conn=null;
SqlCommand cmd = null;
SqlDataAdapter 어댑터 = null;
해 보세요
{
conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;
콘.오픈();
cmd = 새로운 SqlCommand();
cmd.Connection = 연결;
cmd.CommandType = CommandType.Text;
String cmdStr = "dbo.Customers에서 * 선택";
if (Request["id"].ToString()!=String.Empty)
{
cmdStr = " where CustomerID= '" Request["id"].ToString() "'";
}
cmd.CommandText = cmdStr;
어댑터 = 새 SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adapter.Fill(ds);
this.gvData.DataSource = ds;
this.gvData.DataBind();
}
catch
{
Response.Write("오류가 발생했습니다!");
Response.Flush();
응답.끝();
}
드디어
{
if (adapter != null)
{
adapter.Dispose();
}
if (cmd != null)
{
cmd.Dispose();
}
if ((conn != null) && (conn.State == ConnectionState.Open))
{
conn.Close();
}
}
}
}
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.