打印

[NET精华教程] .net教程:东方兄,我搞定了,看代码

.net教程:东方兄,我搞定了,看代码

public void datagrid1_edit(object sender,datagridcommandeventargs e)
        {            
            string strsql;
            string connectionstring;
            connectionstring = configurationsettings.appsettings["connectionstring"];
            datagrid1.edititemindex =(int)e.item.itemindex;   

            bindgrid();                        
            dropdownlist ddl = (dropdownlist)(datagrid1.items[e.item .itemindex].cells [4].controls [1]);

            strsql = "select workstate,itemnumber from asp_temp";   

            oledbconnection myconn=new oledbconnection(connectionstring );
            oledbcommand mycommand=new oledbcommand (strsql,myconn);   
            myconn.open();            
            oledbdatareader myreader=mycommand.executereader();
               
            ddl.datasource =myreader;
            ddl.datatextfield ="workstate";

            ddl.datavaluefield = "itemnumber";
            ddl.databind ();   
            myreader.close();
            myconn.close();            
        }





TOP

返回顶部
AYBlue

Processed in 0.052221 second(s), 7 queries.

当前时区 GMT+8, 现在时间是 2009-1-8 15:49 京ICP备06054220号

清除 Cookies - 联系我们 - 163K.com - Archiver - WAP