0

我将在我的网站上创建一个评论部分,我想将 using 用于我的数据库设置,如下面的代码。那是正确的代码还是?我的英语不太好,但我尽量解释我们可以。

代码将在 btnSend

 using () {
         //Insert the data to the database

        }

  using () {
         //Select  the data from the datbase and the display it 

}

4

1 回答 1

0

我会编写两种单独的方法,一种用于插入,一种用于显示。

protected void insert ()
          {
            /// insert here 
           }
 protected void display()
          {
            ///display logic here 
           }
  btnSend_click ( blah blah)
        {
          insert();
          display();
         }

类似的事情是我一直做的。这是你问的吗?

于 2013-02-15T21:11:42.120 回答