资源简介

c#窗体模式下对用封装的方式对表格内容实现增删改操作,新手可以学一下.里面附有数据库文件及使用说明。已经通过测试。可以学习下

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using sql;

namespace bill
{
    public class yuju
    {
        private string _name;
        private string _pwd;
        private int _uid;

        public string name
        {
            get { return _name; }
            set { _name = value; }
        }
        public string pwd
        {
            get { return _pwd; }
            set { _pwd = value; }
        }
        public int uid
        {
            get { return _uid; }
            set { _uid = value; }
        }
        public bool add(yuju yuju)
        {
            string querystring = “insert into [user] values(‘“+yuju._name+“‘‘“+yuju._pwd+“‘)“;
            Class1 db = new Class1();
            return db.exec(querystring) == 1;
        }
        public bool delete(yuju yuju)
        {
            string querystring = “delete from [user] where uid=‘“+yuju._uid+“‘“;
            Class1 db = new Class1();
            return db.exec(querystring) == 1;
        }
        public bool update(yuju yuju)
        {
            string querystring = “update [user] set name=‘“+yuju._name+“‘pwd=‘“+yuju._pwd+“‘where uid=‘“+yuju._uid+“‘“;
            Class1 db = new Class1();
            return db.exec(querystring) == 1;
        }
        public SqlDataAdapter get()
        {
            string querystring = “select uid as 用户IDname as 用户名 pwd as 密码 from [user]“;
            Class1 db = new Class1();
            SqlDataAdapter da = db.getda(querystring);
            return da;
        }

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    3145728  2010-06-25 12:09  Form增删改操作\database\user.mdf

     文件    1048576  2010-06-25 12:09  Form增删改操作\database\user_log.ldf

     文件       2679  2010-06-22 19:02  Form增删改操作\WindowsFormsApplication1\bill\bill.csproj

     文件       5120  2010-06-25 11:23  Form增删改操作\WindowsFormsApplication1\bill\bin\Debug\bill.dll

     文件      15872  2010-06-25 11:23  Form增删改操作\WindowsFormsApplication1\bill\bin\Debug\bill.pdb

     文件       4608  2010-06-22 19:02  Form增删改操作\WindowsFormsApplication1\bill\bin\Debug\sql.dll

     文件      11776  2010-06-22 19:02  Form增删改操作\WindowsFormsApplication1\bill\bin\Debug\sql.pdb

     文件       1188  2010-06-25 11:23  Form增删改操作\WindowsFormsApplication1\bill\obj\Debug\bill.csproj.FileListAbsolute.txt

     文件       5120  2010-06-25 11:23  Form增删改操作\WindowsFormsApplication1\bill\obj\Debug\bill.dll

     文件      15872  2010-06-25 11:23  Form增删改操作\WindowsFormsApplication1\bill\obj\Debug\bill.pdb

     文件       6219  2010-06-25 11:23  Form增删改操作\WindowsFormsApplication1\bill\obj\Debug\ResolveAssemblyReference.cache

     文件       1346  2010-06-22 18:22  Form增删改操作\WindowsFormsApplication1\bill\Properties\AssemblyInfo.cs

     文件       1664  2010-06-25 11:22  Form增删改操作\WindowsFormsApplication1\bill\yuju.cs

     文件       4608  2010-06-22 19:02  Form增删改操作\WindowsFormsApplication1\sql\bin\Debug\sql.dll

     文件      11776  2010-06-22 19:02  Form增删改操作\WindowsFormsApplication1\sql\bin\Debug\sql.pdb

     文件       1070  2010-06-22 18:38  Form增删改操作\WindowsFormsApplication1\sql\Class1.cs

     文件        468  2010-06-22 19:02  Form增删改操作\WindowsFormsApplication1\sql\obj\Debug\sql.csproj.FileListAbsolute.txt

     文件       4608  2010-06-22 19:02  Form增删改操作\WindowsFormsApplication1\sql\obj\Debug\sql.dll

     文件      11776  2010-06-22 19:02  Form增删改操作\WindowsFormsApplication1\sql\obj\Debug\sql.pdb

     文件       1344  2010-06-22 18:23  Form增删改操作\WindowsFormsApplication1\sql\Properties\AssemblyInfo.cs

     文件       2532  2010-06-22 19:02  Form增删改操作\WindowsFormsApplication1\sql\sql.csproj

     文件        353  2010-06-25 11:20  Form增删改操作\WindowsFormsApplication1\WindowsFormsApplication1\app.config

     文件       5120  2010-06-25 11:23  Form增删改操作\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\bill.dll

     文件      15872  2010-06-25 11:23  Form增删改操作\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\bill.pdb

     文件    2293760  2010-06-22 20:12  Form增删改操作\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\Database1.mdf

     文件     573440  2010-06-22 20:12  Form增删改操作\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\Database1_log.ldf

     文件       4608  2010-06-22 19:02  Form增删改操作\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\sql.dll

     文件      11776  2010-06-22 19:02  Form增删改操作\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\sql.pdb

     文件      12288  2010-06-25 12:08  Form增删改操作\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe

     文件        353  2010-06-25 11:20  Form增删改操作\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config

............此处省略54个文件信息

评论

共有 条评论