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

推荐订阅源

Google Online Security Blog
Google Online Security Blog
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
V
V2EX
雷峰网
雷峰网
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
F
Full Disclosure
Y
Y Combinator Blog
V
V2EX - 技术
Attack and Defense Labs
Attack and Defense Labs
S
Security @ Cisco Blogs
Schneier on Security
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
SecWiki News
SecWiki News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
量子位
PCI Perspectives
PCI Perspectives
S
Secure Thoughts
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AWS News Blog
AWS News Blog
Blog — PlanetScale
Blog — PlanetScale
爱范儿
爱范儿
K
Kaspersky official blog
B
Blog
A
Arctic Wolf
Hacker News: Ask HN
Hacker News: Ask HN
L
LangChain Blog
T
Tor Project blog
P
Privacy & Cybersecurity Law Blog
Recent Announcements
Recent Announcements
宝玉的分享
宝玉的分享
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
Lohrmann on Cybersecurity
D
Docker
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
The Last Watchdog
The Last Watchdog
S
Security Affairs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy International News Feed
Simon Willison's Weblog
Simon Willison's Weblog

博客园 - mengfan

有关DNN2.0中的文章模块(dnnforge.newsarticles)的一个问题??? 投票模块在进行添加模块操作出现错误: 换了DNN的一个皮肤后tab栏的背景色变成了黑的(红色箭头所指),请问该从哪里去掉黑底色呢? 2005/2/21 开始查阅有关gis的相关信息 一些和gis有关的网站 - mengfan 混混钝钝中已开学一周了 将一个新的web项目作为一个DNN的模块添加到DNN里的方法: 用Infragistics的NetAdvantage控件的一些体会 有关级联表中的约束问题? 传参数的方法! 今天是周么:) 如何在页面中设置添加,删除按钮等操作? 关于数据库备份的一个问题?? DNN 汉化中的问题???? 开始看代码rainbow的代码了!!! DNN 汉化中的一个问题??? DNN 汉化中的一个问题??? 发现这两天网速很慢??? 发现了好的网站
关于NetAdvantage中连接数据库的操作总结
mengfan · 2004-10-24 · via 博客园 - mengfan

1.1  动态将一个新建表绑定到UltraWebGrid
                        data=new DataSet("SampleData");
   data.Tables.Add("Materials");
   data.Tables[0].Columns.Add("Product Name");
   data.Tables[0].Columns.Add("Weight (lbs)");
   data.Tables[0].Columns.Add("Price ($)");
   data.Tables[0].Columns.Add("Truck #");
   data.Tables[0].Rows.Add(new object[] {"Sand",500,50.00,"Truck 505"});
   data.Tables[0].Rows.Add(new object[] {"Cement",250,50.00,"Truck 505"});
   data.Tables[0].Rows.Add(new object[] {"Brick",1000,500.00,"Truck 590"});
   data.Tables[0].Rows.Add(new object[] {"6\" Block",800,200.00,"Truck 590"});
   data.Tables[0].Rows.Add(new object[] {"Clean Fill",750,20.00,"Truck 533"});
   data.Tables[0].Rows.Add(new object[] {"Top Soil",2000,200.00,"Truck 501"});
   UltraWebGrid1.DataSource=data.Tables[0].DefaultView;
   UltraWebGrid1.DataBind();
1.2  动态将一个新建表绑定到UltraWebGrid
                       System.Data.DataTable table = new System.Data.DataTable();
       
              System.Data.DataColumn Col1 = new System.Data.DataColumn("PhoneNumbers", Type.GetType("System.Double"));
  System.Data.DataColumn Col2 = new System.Data.DataColumn("Numbers", Type.GetType("System.Double"));
  System.Data.DataColumn Col3 = new System.Data.DataColumn("Dates", Type.GetType("System.DateTime"));
  System.Data.DataColumn Col4 = new System.Data.DataColumn("Currency", Type.GetType("System.Double"));
  dateFormatUS.ShortDatePattern = "MM/dd/yyyy";
 
        table.Columns.Add(Col1);
        table.Columns.Add(Col2);
        table.Columns.Add(Col3);
        table.Columns.Add(Col4);

        DataRow aRow = table.NewRow();
 
        aRow[0] = 6094482000;
 aRow[1] = 111111111;
        aRow[2] = DateTime.Parse("2 / 22 / 02", dateFormatUS);
        aRow[3] = 12;
        table.Rows.Add(aRow);

        aRow = table.NewRow();
        aRow[0] = 6094482017;
        aRow[1] = 123456789;
        aRow[2] = DateTime.Parse("3 / 8 / 02", dateFormatUS);
        aRow[3] = 5678.22;
        table.Rows.Add(aRow);

        aRow = table.NewRow();
        aRow[0] = 8002318588;
        aRow[1] = 987654321;
        aRow[2] = DateTime.Parse("10 / 19 / 71", dateFormatUS);
        aRow[3] = 100000.99;
        table.Rows.Add(aRow);
        //bind to grid
        UltraWebGrid1.DataSource = table;
        UltraWebGrid1.DataBind();
2  通过一般的方法将一个数据库中的表绑定到UltraWebGrid
                string connectionString = "Server=.; Database=Northwind; Integrated Security=True;";
                string sqlConnection = "select * from Customers";
               
                SqlConnection connection = new SqlConnection(connectionString);
                SqlDataAdapter cmdCustomer = new SqlDataAdapter(sqlConnection,connection);
       
                DataSet ds = new DataSet();
                cmdCustomer.Fill(ds,"Customers");
 
                UltraWebGrid1.DataSource = ds;
                UltraWebGrid1.DataBind();

3 通过DAAB将一个数据库中的表绑定到UltraWebGrid
    string connectionString = "Server=.; Database=StarFGS; Integrated Security = True;";
  string sqlConnection = "select * from spflml";

  SqlConnection connection = new SqlConnection(connectionString);
  connection.Open();

  DataSet ds = SqlHelper.ExecuteDataset(connection,CommandType.Text,sqlConnection);
 
  UltraWebGrid2.DataSource=ds;
  UltraWebGrid2.DataBind();
   
  connection.Close();