-
大小: 0.06M文件类型: .zip金币: 1下载: 0 次发布日期: 2020-12-26
- 语言: C#
- 标签: GridView DataGridView WinFrom
资源简介
1.先创建 名为 Sample 的sql server数据库
2. 执行Script.sql脚本
3. 打开解决方案后,即可对 datagridview 进行 增删改查
代码片段和文件信息
using System;
using System.Data;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace InsertUpdateDeleteDemo
{
public partial class frmMain : Form
{
SqlConnection con= new SqlConnection(“Data Source=.;Initial Catalog=Sample;Integrated Security=true;“);
SqlCommand cmd;
SqlDataAdapter adapt;
//ID variable used in Updating and Deleting Record
int ID = 0;
public frmMain()
{
InitializeComponent();
DisplayData();
}
//Insert Data
private void btn_Insert_Click(object sender EventArgs e)
{
if (txt_Name.Text != ““ && txt_State.Text != ““)
{
cmd = new SqlCommand(“insert into tbl_Record(NameState) values
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-01-28 14:08 Insert Update Delete Source Code\
目录 0 2015-01-25 00:07 Insert Update Delete Source Code\InsertUpdateDeleteDemo\
目录 0 2015-01-28 13:04 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\
目录 0 2015-01-28 13:04 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\bin\
目录 0 2015-01-28 13:04 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\bin\Debug\
文件 12800 2015-01-28 13:06 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\bin\Debug\InsertUpdateDeleteDemo.exe
文件 30208 2015-01-28 13:06 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\bin\Debug\InsertUpdateDeleteDemo.pdb
文件 21464 2015-01-28 13:06 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\bin\Debug\InsertUpdateDeleteDemo.vshost.exe
目录 0 2015-01-28 13:04 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\bin\Release\
文件 3786 2015-01-28 13:19 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\frmMain.cs
文件 7064 2015-01-28 13:04 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\frmMain.Designer.cs
文件 5817 2015-01-28 01:55 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\frmMain.resx
文件 3721 2015-01-28 13:04 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo.csproj
目录 0 2015-01-25 00:07 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\obj\
目录 0 2015-01-28 13:06 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\obj\Debug\
文件 1229 2015-01-28 01:15 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7028 2015-01-28 13:04 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 1300 2015-01-28 13:06 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\obj\Debug\InsertUpdateDeleteDemo.csproj.FileListAbsolute.txt
文件 907 2015-01-28 13:04 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\obj\Debug\InsertUpdateDeleteDemo.csproj.GenerateResource.Cache
文件 1757 2015-01-28 01:23 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\obj\Debug\InsertUpdateDeleteDemo.csprojResolveAssemblyReference.cache
文件 12800 2015-01-28 13:06 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\obj\Debug\InsertUpdateDeleteDemo.exe
文件 180 2015-01-28 13:04 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\obj\Debug\InsertUpdateDeleteDemo.frmMain.resources
文件 30208 2015-01-28 13:06 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\obj\Debug\InsertUpdateDeleteDemo.pdb
文件 180 2015-01-28 13:04 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\obj\Debug\InsertUpdateDeleteDemo.Properties.Resources.resources
目录 0 2015-01-25 00:07 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\obj\Debug\TempPE\
文件 516 2015-01-28 13:04 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\Program.cs
目录 0 2015-01-25 00:07 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\Properties\
文件 1456 2015-01-25 00:07 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\Properties\AssemblyInfo.cs
文件 2874 2015-01-25 00:07 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\Properties\Resources.Designer.cs
文件 5612 2015-01-25 00:07 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\Properties\Resources.resx
文件 1109 2015-01-25 00:07 Insert Update Delete Source Code\InsertUpdateDeleteDemo\InsertUpdateDeleteDemo\Properties\Settings.Designer.cs
............此处省略4个文件信息
- 上一篇:C#股票投资分析软件(附权限管理功能)
- 下一篇:数据库 Healper源类代码
相关资源
- C#winfrom图片查看浏览器
- WinForm嵌入Word文档控件开发
- C#访问SQL显示到DataGridView,同时根据
- C#工资管理系统,WINFrom
- DataGridView修改后直接保存到数据库程
- C# 导入excel到datagridview
- C#dataGridView中输入框自动提示、自动完
- ASP.NET固定GridView表头_SuperTables
- C# winfrom窗体显示百度地图
- 两个DataGridView通过委托实时传值,安
- TreeDataGridView
- ASP.NET 三层结构下使用GridView增删改查
- winForm编写的漂亮时钟源码
- C# winform datagridview 里的下拉框中 既可
- GridView的增删改查功能
- DataGridView列标头带数据筛选功能(含
- C#winform DataGridView checkbox复选框 实现
- C#_winform_DataGridView_checkbox复选框_实现
- C# DataGridView单元格中动态添加多个控
- 计算机网络课程设计-TCP聊天系统课程
- C# winfrom 自动登录网页 提取网页内容
- c# winfrom实现票据打印系统源代码自己
- Q758437.zip c#中如何将datagridview中的数据
- c#winform开发仓库管理系统,vs2010,m
- asp.net c#gridview对数据进行绑定增加查
- C#从Excel中提取数据到DataGridView中显示
- C# 从Excel导入数据到DataGridView、SqlSe
-
C# winfrom操作xm
l_读写修改xm l及写入 - C#对DataGridView进行添加、修改、删除数
- C# datagridview 与数据源绑定后对数据的
评论
共有 条评论