我在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)