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

推荐订阅源

博客园 - 司徒正美
博客园 - 【当耐特】
Stack Overflow Blog
Stack Overflow Blog
S
Schneier on Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LINUX DO - 热门话题
Spread Privacy
Spread Privacy
雷峰网
雷峰网
博客园 - 叶小钗
L
LangChain Blog
MyScale Blog
MyScale Blog
Security Latest
Security Latest
AWS News Blog
AWS News Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Hugging Face - Blog
Hugging Face - Blog
S
Securelist
The Hacker News
The Hacker News
T
Threatpost
Martin Fowler
Martin Fowler
Vercel News
Vercel News
Scott Helme
Scott Helme
S
Security @ Cisco Blogs
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
The GitHub Blog
The GitHub Blog
L
Lohrmann on Cybersecurity
Google Online Security Blog
Google Online Security Blog
T
Threat Research - Cisco Blogs
The Register - Security
The Register - Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
About on SuperTechFans
爱范儿
爱范儿
G
Google Developers Blog
B
Blog
C
Check Point Blog
G
GRAHAM CLULEY
T
Troy Hunt's Blog
V
Visual Studio Blog
T
The Blog of Author Tim Ferriss
C
Cisco Blogs
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
TaoSecurity Blog
TaoSecurity Blog
W
WeLiveSecurity
AI
AI
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Tailwind CSS Blog

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