Tuesday, February 23, 2010

How to convert SqlDataReader or DataReader to DataTable in Asp.Net

In many cases we need to convert or converting SqlDataReader or DataReader to a DataTableto meet some technical challenges. Here i will show you converting SqlDataReader to a DataTable in a simple way. The code sample is given below:













protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string sql = "SELECT B.Name [Brand Name],

No comments:

Post a Comment