15 May 2011

SqlDataReader To DataTable

class ClsDataReaderToDataTable
    static void Main(string[] args)
        string StrQuery = "SELECT * from MyTable";
        DataTable DtCustomers = new DataTable();
        using (SqlConnection oConn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionstring"].ConnectionString))
            SqlCommand SCmd = new SqlCommand(StrQuery, oConn);
            SqlDataReader SDr = SCmd.ExecuteReader();

No comments:

Post a Comment

Your comments, Feedbacks and Suggestions are very much valuable to me :)

Things are upgraded

My Dear readers, I am really thankful for being supportive all these years. This site was the first blog site I ever created in my life...