在Asp.NET中使用Ajax显示来自SQL Server数据库的数据 [英] Displaying data from sql server database using Ajax in Asp.NET

查看:346
本文介绍了在Asp.NET中使用Ajax显示来自SQL Server数据库的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在从事一个项目,该项目负责从sql服务器数据库中检索数据并在.aspx页的html表中显示数据.谁能帮我解决这个问题

I am currently working on a project which deals with retrieving data from sql server database and display the data in html table in my .aspx page. Can anyone help me figure out this problem

推荐答案

http://msdn.microsoft.com/en-us/library/tw738475.aspx [ ^ ]

但认真的说,www.asp.net上有很多示例涉及数据访问.可能还有十亿个其他博客.
http://msdn.microsoft.com/en-us/library/tw738475.aspx[^]

But seriously, there are plenty of examples on www.asp.net covering data access. And probably a billion other blogs out there.


DataTable objDataTableReceiptDetails = new DataTable();
            objSiteRegistrationBLL.SiteGetReceiptDetails(objSiteBookingDTO, ref objDataTableReceiptDetails);
            string table = "<table>";
            for (int i = 0; i < objDataTableReceiptDetails.Rows.Count; i++)
            {
                table =table+ string.Format("<tr><td>" + objDataTableReceiptDetails.Rows[i][0].ToString() + "</td><td>" + objDataTableReceiptDetails.Rows[i][1].ToString()+"</td></tr>");
                
            }
            table = table + "</table>";

            Response.Write(table);




希望对您有帮助




Hope this will help you


这篇关于在Asp.NET中使用Ajax显示来自SQL Server数据库的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆