今天和昨天学习的内容:
1.SQL2005数据库的连接:
c# 代码
- using System.Data.SqlClient;
- String sql = "select id,title,time from news order by id desc";
- private SqlConnection con=con = new SqlConnection("server=192.168.1.118\\sqlexpress;database=news;uid=sa;pwd='kings'");
- con.Open();
- DataSet ds = new DataSet();
- SqlDataAdapter cmd = new SqlDataAdapter(sql, con);
- cmd.Fill(ds, "news");
- DataGrid1.DataSource = ds.Tables["news"].DefaultView;
- DataGrid1.DataBind();
c# 代码
- con.Open();
- String sql = "delete from news where id=" +(c_id.Text.Trim());
- cmd = new SqlCommand(sql,con);
- cmd.ExecuteNonQuery();
c# 代码
- SqlCommand cmd = new SqlCommand("select * from yanzheng", conn);
- SqlDataReader myReader=null;
- conn.Open();
- try
- {
- myReader = cmd.ExecuteReader();
- while (myReader.Read())
- {
- name=(String)myReader["name"];
- password=(String)myReader["password"];
- }
-
-
- }
- catch (Exception ex) {
-
- Response.Write(ex.ToString());
- }
- finally {
-
- if(myReader!=null)
- myReader.Close();
- if (conn.State == ConnectionState.Open)
- conn.Close();
- }
-
c# 代码
-
- Width="500px"
- PagerStyle-HorizontalAlign="left"
- PagerStyle-Mode="NumericPages"
- OnPageIndexChanged="ChangePage"
- HeaderStyle-BackColor="#AAAADD"
- AlternatingItemStyle-BackColor="#ffffcd"
- BorderColor="Black"
- CellPadding="0"
- CellSpacing="0"
- AutoGenerateColumns="false"
- PageSize="20" AllowPaging="True"
-
- >
- <columns></columns>
-
- "Left" />
-
-
-
- "AntiqueWhite" />
- "Left" Mode="NumericPages" />
- "#FFFFCD" />
-
2.DataAdapter对象和DataSet对象:
DataAdapter对象用于获取数据,填充DATASET中的表和约束将对DATASET的更改提交回数据员.
分享到:
相关推荐
2007-02-17 06:43 29,184 iispwchg.dll 2007-02-17 06:44 349,696 w3core.dll 2005-04-04 00:00 83,754 w3core.mfl 2005-04-04 00:00 74,002 w3core.mof 2007-02-17 06:44 39,424 w3dt.dll 2007-02-17 06:50 4,862 ...
汇编语言入门教程2007-04-29 22:04对初学者而言,汇编的许多命令太复杂,往往学习很长时间也写不出一个漂漂亮亮的程序,以致妨碍了我们学习汇编的兴趣,不少人就此放弃。所以我个人看法学汇编,不一定要写程序,写...
2007-05-04 12:29 145,408 iische51.dll 2007-05-04 12:39 79,872 iislog51.dll 2011-01-18 22:11 15,360 inetin51.exe 2004-01-26 01:27 77,824 metada51.dll 2007-10-18 23:44 46,592 svcext51.dll 2011-01-18 22:...
Create: 2007-04-29 Version: 1.0 Language: VBscript <!--#include file="Inc/conn.inc"--> <!--#include file="Inc/checkUserName.inc"--> <!--#include file="Inc/saveNRegUser.inc"--> userName = request...
2007-04-16 00:44 810,873 OEM-DIY品牌自己做5.1.exe 2008-02-08 15:57 326,656 TCPIP并发连接数修改.exe 2007-10-18 19:33 120,832 U盘病毒免疫器.exe 2008-03-05 03:07 <DIR> XP序列号替换器 2008-05-29 11:49 1,...
2004-10-29 04:21 1,705 aodv_hello.h 2004-10-29 04:21 5,898 aodv_neighbor.c 2004-10-29 04:21 1,385 aodv_neighbor.h 2004-10-29 04:21 6,178 aodv_rerr.c 2006-02-01 04:28 2,416 aodv_rerr.h 2004-10-29 04:21...
2007-03-29 1、增加html获取get变量,并设置初始reciveUser, 以弹出窗口形式打开不同客服的客户端; 2、新增上述客户端代码的测试页面,并支持 点击按钮往左缩进屏幕,再次点击恢复原来位置; 2007-03-31 1...
时间跨度:2007-2021年 区域范围 :上市公司 参考文献: [苑贵敬.高管薪酬攀比、市场化进程和会计信息可比性[J] .中国总会计师,2023(04):96-99. [2]乔贵涛,李佳琪.实体企业金 融化对会计信息可比性的影响[J].会计之...
Date: 2008/04/29 Fix: 12. Change G122.C1 utility version to 3.30(E) ------------------------------------------------------------------------------------------- Setup Version: S0038 Build: 62224 ...
2010-04-09 20:18 331 247 Coolvibes\Client\Configuracion.ini 2009-08-17 22:40 1264 514 Coolvibes\Client\Coolvibes.dpr 2008-11-18 16:44 5120 1395 Coolvibes\Client\Coolvibes.res 2010-05-03 21:14 106 78 ...
2007-10-20 20:22 17,428 HTMLTag-entities.ini 2017-10-06 14:02 278,016 JSMinNPP.dll 2017-08-29 08:43 98,992 mimeTools.dll 2010-06-04 16:02 282,624 MultiClipboard.dll 2010-06-04 16:02 50,176 ...
Second Version by mrlong on 2007-12-25 https://code.google.com/p/mycom/ 增加 ClosePort 增加 WriteToPort 两个方法 增加 SendData 与 RecvData 方法 by liquanhai on 2011-11-04 ...
- 发布日期:2007-09-29 9. **固件版本:01.0A.10** - 量产工具版本:v1.89&v1.96 - 发布日期:2007-09-29 10. **固件版本:01.0C.10** - 量产工具版本:v1.96 - 发布日期:2008-01-07 11. **固件版本:...
2007-04-27 10:17 87,424 streams.exe 2009-02-27 17:22 136,592 strings.exe 2006-11-01 14:05 150,328 sync.exe 2009-03-16 12:16 150,888 tcpvcon.exe 2006-10-30 10:32 40,016 tcpview.chm 2009-03-16 12:16 198...
2004-02-04 22:04 2512 281 BusinessSkinForm\Animate3\mainmenuitems.bmp 2003-11-01 23:43 3602 92 BusinessSkinForm\Animate3\mdibg.bmp 2004-02-04 22:05 4208 483 BusinessSkinForm\Animate3\menuitems.bmp ...
(29, '10', 'Å£Îľü', '2008-04-17', '´ó¼ÒºÃ°¡'), (30, '3', '³þÏس¤', '2008-04-17', 'ͬ־ÃÇÐÁ¿àÁË£¡'), (32, '1', '123', '2008-04-17', '123'), (33, '4', '123', '2008-04-...
CNAS实验室认可规范文件清单(2019-5-29) 本文档为CNAS实验室认可规范文件清单,涵盖了实验室认可的各个方面,包括通用认可规则、实验室专用认可规则、能力验证规则、收费管理规则、境外实验室和检验机构受理规则...
29 至 2022-04-25) 二. 向银行贷款信息 1. 上市公司向银行借款 表(日)(2000-01-11 至 2022-04-25) 2. 上市公司银行贷 款担保情况表(日)(1998-01-17 至 2022-04-25) 3. 上市 公司向银行借款统计表(半年)...
2007-4-29 默认端口有两个,当你启用了IIS的时候,它会自动调用8081端口,聪明了一点...(已上传) 2007-5-25 新增自定义目录浏览,新增ftp服务器 2007-6-1 完善Ftp服务器功能 2007-6-15 新增完全自定义默认主页,完全...
2005-04-29 18:01 8243 72 madExcept\Demos\EC.bdsproj 2004-10-03 11:00 8246 80 madCodeHook\Demos\system wide\VariousDlls\Empty.bdsproj 2004-10-03 10:36 8249 77 madExcept\Demos\ExcCatch.bdsproj 2004-10-...