小编Ahm*_*Gha的帖子

使用类和存储过程在C#(Visual 2015)中将数据插入SQL Server 2014

我在SQL Server数据库中插入数据时遇到问题.我正在使用一个名为book的类,在我的表单设计中,当我想插入数据时,我收到错误.

class Book
{
    private string _bookname;
    private int _bookcode;
    private int _numberofpages;
    private string _author;
    private string _publicationname;
    private string _genre;
    private int _publishyear;
    private string _language;
     SqlConnection _sqlcon = new SqlConnection();

    public Book(SqlConnection sqlcon)
    {
        _sqlcon = sqlcon;
    }

    public string bookname
    {
        get { return _bookname; }
        set { _bookname = value; }
    }
    public int bookcode
    { 
    get { return _bookcode; }
    set { _bookcode = value; }
        }
    public int numberofpages
    {
        get { …
Run Code Online (Sandbox Code Playgroud)

c# sql-server class

3
推荐指数
1
解决办法
141
查看次数

标签 统计

c# ×1

class ×1

sql-server ×1