C# WIN 桌面开发共12篇
C# WIN 桌面开发

c# 判断dataset 或data table是否为空

if(ds != null && ds.Tables.Count>=0 && ds.Tables[0].Rows.Count>0) { ds.Table[0].Row[0]['name'];  }  判断DataSet是否为空//*****************...
bpdama的头像-BP大马随笔bpdama3年前
09015

DataSet和DataTable

每一个DataSet都是一个或多个DataTable 对象的集合(DataTable相当于数据库中的表),这些对象由数据行(DataRow)、数据列(DataColumn)、字段名(Column Name)、数据格(Item),以及约束(...
bpdama的头像-BP大马随笔bpdama3年前
013614

c# 子类继承父类

要注意些问题, 要习惯在建立类的时候,将默认的构造函数先建立一个,如果默认的构造函数没有建立,比如在父类中建立了一个带参构造函数,那么子类中的构造函数就会出错. 另外,子类的构造函数,总是先...
bpdama的头像-BP大马随笔bpdama3年前
09713

c# 代码更改dataset某单元的内容以及绑定数据到combobox中,并且写入数组

private string connstr = 'Provider = Microsoft.Jet.OLEDB.4.0; Data Source = aaa.mdb'; public DataSet getlist(string str, string tableName)        {   ...
bpdama的头像-BP大马随笔bpdama3年前
013110

c# winform 删除datagridview中的checkbox选定的行

private void indexBtnDelete_Click(object sender, EventArgs e)        {            string strNames = '您选择的是:';    &...

c# sql 数据库 多表关联 根据一个表的字段 读取另一个表的内容

数据库中有3个表,分别是:1. Person字段为: ID;NAME;JOBID;CLASSID              1    李明&nb...
bpdama的头像-BP大马随笔bpdama3年前
09610

C#—数据库访问通用类、Access数据库操作类、mysql类

//C# 数据库访问通用类 (ADO.NET) using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Data.SqlClient; using System.Configuration; names...
bpdama的头像-BP大马随笔bpdama3年前
012410

c# 的4种访问修饰符

c# 的4种访问修饰符: private私有的,只在本类中允许访问不能被继承 protected只在本类中允许访问可以被继承 internal可以在本项目中访问可以被继承 public可以在本项目外访问可以被继承 
bpdama的头像-BP大马随笔bpdama3年前
0649

C# winform中OpenFileDialog的运用还可以多选

using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Data.OleDb; using System.Runt...
bpdama的头像-BP大马随笔bpdama3年前
0799

c# 将datagridview某一列设定为不可编辑或可编辑

this.indexDataGridView1.Columns[1].ReadOnly = true; this.indexDataGridView1.Columns[2].ReadOnly = true; this.indexDataGridView1.Columns[3].ReadOnly = true; this.indexDataGridView1....
bpdama的头像-BP大马随笔bpdama3年前
0738