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

推荐订阅源

Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
博客园 - 聂微东
S
Schneier on Security
The Last Watchdog
The Last Watchdog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Webroot Blog
Webroot Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Schneier on Security
Schneier on Security
PCI Perspectives
PCI Perspectives
C
Cyber Attacks, Cyber Crime and Cyber Security
V
Visual Studio Blog
Blog — PlanetScale
Blog — PlanetScale
Spread Privacy
Spread Privacy
Cisco Talos Blog
Cisco Talos Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Help Net Security
Help Net Security
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
NISL@THU
NISL@THU
博客园 - Franky
N
Netflix TechBlog - Medium
Know Your Adversary
Know Your Adversary
L
Lohrmann on Cybersecurity
F
Fortinet All Blogs
WordPress大学
WordPress大学
U
Unit 42
Hacker News: Ask HN
Hacker News: Ask HN
Recent Announcements
Recent Announcements
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
A
Arctic Wolf
酷 壳 – CoolShell
酷 壳 – CoolShell
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Security Affairs
H
Hacker News: Front Page
TaoSecurity Blog
TaoSecurity Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog RSS Feed
罗磊的独立博客
Cloudbric
Cloudbric
Y
Y Combinator Blog
B
Blog
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
L
LINUX DO - 最新话题
The Register - Security
The Register - Security
D
DataBreaches.Net
GbyAI
GbyAI

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