在.NET中 简单的SQL语句有必要用存储过程吗??
我以前写程序,简单的一般都直接用SQL语句,比如
this.myclass.ConOpen();
OracleDataAdapter da=new OracleDataAdapter("select * from laobaopin where laobaoname='"+this.txtname.Text+"'",this.myclass.cnn);
this.DataGrid1.DataKeyField="lbid";
DataSet ds=new DataSet();
da.Fill(ds);
this.DataGrid1.DataSource=ds;
this.DataBind();
this.myclass.ConClose();
很少用存储过程,复杂的有时候用,网上一些资料说存储过程可以提高效率,所以我想把涉及SQL语句的都用存储过程来实现。但有听人说简单的SQL语句不用用存储过程,那样并不能提高效率,用基本的方法就可以了
我很犹豫,请大家说说你们的想法!!谢谢