首先把AjaxPro.dll文件添加到引用中,可以到http://www.schwarz-interactive.de/下载 根据你的.net 版本来选择不同的DLL文件.
default.aspx.cs:
public partial class _Default : System.Web.UI.Page
{
    string connectString = "";//定义自已的连接串    
    protected void Page_Load(object sender, EventArgs e)
    {
        AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default));
    }
    [AjaxPro.AjaxMethod]
    public DataTable GetDataTable()
    {
        SqlDataAdapter ad = new SqlDataAdapter("select * from tableName", connectString);
        DataSet ds = new DataSet();
        ad.Fill(ds);
        int num = ds.Tables[0].Rows.Count;
        return ds.Tables[0];
    }
}

相关文章:

  • 2021-10-29
  • 2022-01-12
  • 2021-10-08
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
  • 2022-02-24
  • 2021-10-29
  • 2022-12-23
  • 2021-03-30
相关资源
相似解决方案