惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Archives - TechRepublic
Security Archives - TechRepublic
C
CXSECURITY Database RSS Feed - CXSecurity.com
NISL@THU
NISL@THU
S
Schneier on Security
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Tenable Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google Online Security Blog
Google Online Security Blog
GbyAI
GbyAI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
Forbes - Security
Forbes - Security
博客园 - 叶小钗
量子位
I
Intezer
腾讯CDC
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
F
Fortinet All Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
Jina AI
Jina AI
Project Zero
Project Zero
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
Latest news
Latest news
Cyberwarzone
Cyberwarzone
Security Latest
Security Latest
Spread Privacy
Spread Privacy
M
MIT News - Artificial intelligence
F
Full Disclosure
P
Proofpoint News Feed
B
Blog
W
WeLiveSecurity
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
AWS News Blog
AWS News Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
The GitHub Blog
The GitHub Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
博客园 - 聂微东
小众软件
小众软件
Schneier on Security
Schneier on Security
PCI Perspectives
PCI Perspectives

博客园 - eFeng.Leung

枚举Exchange Server、SotreGroups和MailStore Single Sign-On for everyone 关于AD编程的一些资料 zz 不同的asp.net web应用程序间共享Session/Application - eFeng.Leung - 博客园 Code Project中几篇关于DNN的文章 Authenticate a user against the Active Directory using the user ID and password User Object User Interface Mapping Lists all entries in the Active Directory Using Active Directory Active Directory and .NET LDAP, IIS and WinNT Directory Services 无法破解的软件注册码算法 SQL2K集群 绑定在 TCP 端口 1433 上失败 使用HTTP访问2003表单登录页 (转) FYI: Getting Started with WebDAV 遭遇 对路径“C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\aa\……”的访问被拒绝 - eFeng.Leung 网络负载平衡部署 Group Panel 鼠标移动,改变datagrid里行的色
在DataGrid里显示Excel文件数据
eFeng.Leung · 2006-01-26 · via 博客园 - eFeng.Leung

    using System.Data.OleDb;

private void Page_Load(object sender, System.EventArgs e)
        
{
            
// 在此处放置用户代码以初始化页面
            if(!IsPostBack) 
            
{
                SetBind() ;
            }

        }

        
protected void SetBind() 
        
{
            
try
            
{
                
string strConn; 
                strConn 
= "Provider=Microsoft.Jet.OLEDB.4.0;" 
                    
+"Data Source=c:\\abc.xls;" 
                    
+"Extended Properties=Excel 8.0;"
                
OleDbDataAdapter myCommand   = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", strConn); 
                DataSet myDataSet 
= new DataSet(); 
                myCommand.Fill( myDataSet, 
"mobile"); 
                DataGrid1.DataSource 
= myDataSet.Tables["mobile"].DefaultView; 
                DataGrid1.DataBind();
            }

            
catch (Exception ex)
            
{
                Label1.Text 
= ex.ToString();
            }

        }


        
private void DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
        
{
            
this.DataGrid1.CurrentPageIndex =   e.NewPageIndex;
            SetBind() ;
        }


        
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
        
{
            
if(e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem )
            
{
               

                e.Item.Attributes.Add("onmouseover","this.style.backgroundColor='Silver' ");
                e.Item.Attributes.Add(
"onmouseout","this.style.backgroundColor='white' ");
                        }
            }