Sub insertnews(ByVal news_title AsString,ByVal news_content asstring)
oledbHelper.ExecuteNonquery(oledbHelper.accessconstr, CommandType.Text, "insert into headweb_news (news_title) values (@news_title)", getPars(news_title,news_content)//已获取Parameter数组)
End Sub
这一步已经成功了,现在是参数news_title是可以动态配置的变量组,假设是通过字符串"news_title,news_content"转换成dim news_title as string,dim news_content as string作为参数
老实说,不太明白你在说什么。。。 我猜,你是想让这个方法只接收一个参数,但是能同时将news_title和news_content传进来 如果是这样,定义一个News类吧 public class News{ ///字段
///属性 public string news_title{ .... } public string news_content{ .... } ..... }
Sub insertnews(News _news) oledbHelper.ExecuteNonquery(oledbHelper.accessconstr, CommandType.Text, "insert into headweb_news (news_title) values (@news_title)", getPars(_news.news_title,_news.news_content)//已获取Parameter数组) End Sub