ado.net增删查改小总结_1

上传人:bin****86 文档编号:59370212 上传时间:2018-11-06 格式:DOCX 页数:3 大小:15.47KB
返回 下载 相关 举报
ado.net增删查改小总结_1_第1页
第1页 / 共3页
ado.net增删查改小总结_1_第2页
第2页 / 共3页
ado.net增删查改小总结_1_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

《ado.net增删查改小总结_1》由会员分享,可在线阅读,更多相关《ado.net增删查改小总结_1(3页珍藏版)》请在金锄头文库上搜索。

1、我真正系统地接触和学习党的基本知识是在这次中级党校的培训班上。通过学习,了解了党的发展历程,对党的性质、宗旨、任务等基本知识有了进一步的了解ADO.NET增删查改小总结三套路-增删改Code1 using System.Data.SqlClient;23 SqlConnection conn = new SqlConnection(xxx);456 string sql = xxx;78 SqlCommand comm = new SqlCommand(sql, conn);910 conn.Open();1112 comm.ExecuteNonQuery();1314 conn.Close(

2、);三套路-查(绑定到DataGridViewCode1 using System.Data.SqlClient;23 SqlConnection conn = new SqlConnection(xxx);45 string sql = xxx;67 SqlDataAdapter da = new SqlDataAdapter(sql, conn);89 DataSet ds = new DataSet();1011 da.Fill(ds);1213 dataGridView1.DataSource = ds.Tables0;1415 /要更新 查询语句要 查询主键列1617 SqlComm

3、andBuilder sd = new SqlCommandBuilder(da);1819 da.Update(ds.Tables0);三套路-查(绑定到ListView)代码using System.Data.SqlClient;SqlConnection conn = new SqlConnection(xxx);string sql = xx;SqlCommand comm = new SqlCommand(sql, conn);conn.Open();SqlDataReader read = comm.ExecuteReader();while (read.Read()ListViewItem lvi = new ListViewItem(readxxx.ToString();lvi.Tag = readid;listView1.Items.Add(lvi);lvi.SubItems.AddRange(new String readxxx.ToString() );read.Close();conn.Close();对党的认识也有了进一步的提高。才真正体会到了中国共产党的伟大、光荣和正确,更感到只有中国共产党是全中国最广大人民利益的忠实代表

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 总结/报告

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号