Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 8th, 2006, 02:22 AM
Authorized User
 
Join Date: Oct 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default PERFORMENCE ISSUE

ok here is a the problem i and my partner have an argument over some coding which will be more faster the purpose is to bind dropdownlist
I have written a code which take the control as parameter and my partner wans to bind every control individually.here is two codes

What I written:
public bool FillDropDownList(DropDownList dDl,string TableName,string DataTextField,string DataValueField)
        {
            string Select="SELECT "+DataTextField+", "+DataValueField+" FROM "+TableName+"";
            OleDbConnection conn=new OleDbConnection();
            string connString = ConfigurationSettings.AppSettings["connectionstring"];
            conn.ConnectionString=connString;
            OleDbCommand m_Command = new OleDbCommand(Select,conn);
            try
            {
                dDl.DataValueField = DataValueField;
                dDl.DataTextField = DataTextField;
                conn.Open();
                OleDbDataReader m_DataReader = m_Command.ExecuteReader();
                dDl.DataSource = m_DataReader;
                dDl.DataBind();
                m_DataReader.Close();
            }
            catch
            {
                return false;

            }
            finally
            {
                m_Command.Dispose();
                conn.Close();
                conn.Dispose();
            }
            return true;
        }
and what my partner wrttien:
private void BindLoanAppliedCombo()
        {
            string strSQL = string.Empty;
            strSQL = " SELECT * FROM LOAN_TYPE";
            SystemUtility.SystemUtility util = new SystemUtility.SystemUtility();

            Listloanappliedfor.DataSource = util.RetrieveRS(strSQL);
            Listloanappliedfor.DataTextField = "LOAN_TYPE";
            Listloanappliedfor.DataValueField = "LOAN_TYPE_ID";
            Listloanappliedfor.DataBind();
        }

Please help to end this argument






Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop Down Issue SKhna ASP.NET 2.0 Basics 1 March 19th, 2008 06:29 AM
How to check the performence of a storeprocedure? vijaykumartaduri SQL Server 2000 2 March 29th, 2007 01:15 AM
Another issue islandtiu BOOK: Beginning ASP 3.0 1 February 14th, 2005 11:49 AM
Sub Report Issue bjoneskc01 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 January 21st, 2005 11:26 AM
Query performence ARahman SQL Server 2000 2 August 25th, 2003 09:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.