日期:2014-05-18  浏览次数:20918 次

急求解决!!
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OracleClient;



/// <summary>
/// Dal 数据操作类
/// </summary>
public class Dal:DataBase
{
  private OracleCommand Cmd=null;
  private DataSet Ds = null;
  private DataTable Dt=null;
public Dal()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
  /// <summary>
  /// 检测 用户登陆
  /// </summary>
  /// <param name="info"></param>
  /// <returns></returns>
  public DataTable CheckLogin(Info info)
  {
   
  string strOracle = "select * from [info] where I_UserName=@username and I_UserPwd=@userpwd";
  OracleParameter[] parms ={ new OracleParameter("@username",OracleType.VarChar,100),
  new OracleParameter("@userpwd",OracleType.VarChar,200)};
  parms[0].Value = info.Name;
  parms[1].Value = info.Pwd;
  try
  {
  Cmd = ExecuteCmd(strOracle, parms);
  Dt = ExecuteDataTable(Cmd);
  }
  catch (OracleException ex)
  {
  throw new Exception(ex.Message, ex);
  }
  return Dt;


  }

大家帮忙看一看,调试段程序出现:与“DataBase.ExecuteDataTable(System.Data.SqlClient.SqlCommand)”最匹配的重载方法具有一些无效参数 错误!!是怎么回事呢??应该怎样修改呢??

------解决方案--------------------
Dt = ExecuteDataTable(Cmd); 

这一句错了,检查一下你的继承的DataBase类中的ExecuteDataTable方法,参数的类型和个数对不对!