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

推荐订阅源

The Hacker News
The Hacker News
B
Blog RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
L
LangChain Blog
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
F
Full Disclosure
T
The Blog of Author Tim Ferriss
月光博客
月光博客
有赞技术团队
有赞技术团队
Last Week in AI
Last Week in AI
aimingoo的专栏
aimingoo的专栏
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
博客园 - Franky
B
Blog
博客园_首页
C
CERT Recently Published Vulnerability Notes
Hugging Face - Blog
Hugging Face - Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
K
Kaspersky official blog
I
Intezer
P
Proofpoint News Feed
博客园 - 叶小钗
S
Schneier on Security
P
Privacy & Cybersecurity Law Blog
Recorded Future
Recorded Future
NISL@THU
NISL@THU
A
Arctic Wolf
Know Your Adversary
Know Your Adversary
C
Cyber Attacks, Cyber Crime and Cyber Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
C
Cisco Blogs
大猫的无限游戏
大猫的无限游戏
S
Secure Thoughts
T
The Exploit Database - CXSecurity.com
Forbes - Security
Forbes - Security
Project Zero
Project Zero
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Cisco Talos Blog
Cisco Talos Blog
D
Docker
Blog — PlanetScale
Blog — PlanetScale
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理

博客园 - 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' ");
                        }
            }