Hi All,
I encounter a very very weird error which i do not face in Visual Studio 2010.
All the SQL result return in dataset format has 0 row even if it should return record after adding table to DataSet.xsd.
Below is my code which should return me a row but after adding a datable to Dataset.xsd it returns me 0 records.
protectedvoidPage_Load(object sender,EventArgs e){DataSet dsUser =newDataSet();Int32 icount; dsUser =SearchUser("ELIM","","","","ALL","ALL"); icount = dsUser.Tables[0].Rows.Count;}privateDataSetSearchUser(String vstrNTAcc,String vstrEmpNo,String vstrName,String vstrRole,String vstrStatus,String vstrCertApprv){DataSet dsUser =newDataSet();String oradb =""; oradb =ConfigurationManager.AppSettings["BARWEBConnString"].ToString();OracleConnection oconn =newOracleConnection(oradb);try{ vstrNTAcc = vstrNTAcc.ToUpper(); vstrEmpNo = vstrEmpNo.ToUpper(); vstrName = vstrName.ToUpper(); vstrRole = vstrRole.ToUpper(); vstrStatus = vstrStatus.ToUpper();if(vstrNTAcc ==""){ vstrNTAcc ="%";}if(vstrEmpNo ==""){ vstrEmpNo ="%";}if(vstrName ==""){ vstrName ="%";}if(vstrRole =="ALL"){ vstrRole ="%";}else{ vstrRole ="%"+ vstrRole +'%';}if(vstrStatus =="ALL"){ vstrStatus ="%";}if(vstrCertApprv =="ALL"){ vstrCertApprv ="%";}OracleCommand ocmd =newOracleCommand(); oconn.Open(); ocmd.Connection= oconn; ocmd.CommandType=CommandType.StoredProcedure; ocmd.CommandText="BAR_WEB.S_COC_GET_USER";OracleParameterOPNTAcc=newOracleParameter();OPNTAcc.Direction=ParameterDirection.Input;OPNTAcc.Value= vstrNTAcc; ocmd.Parameters.Add(OPNTAcc);OracleParameterOPEmpNo=newOracleParameter();OPEmpNo.Direction=ParameterDirection.Input;OPEmpNo.Value= vstrEmpNo; ocmd.Parameters.Add(OPEmpNo);OracleParameterOPName=newOracleParameter();OPName.Direction=ParameterDirection.Input;OPName.Value= vstrName; ocmd.Parameters.Add(OPName);OracleParameterOPRole=newOracleParameter();OPRole.Direction=ParameterDirection.Input;OPRole.Value= vstrRole; ocmd.Parameters.Add(OPRole);OracleParameterOPCertApprv=newOracleParameter();OPCertApprv.Direction=ParameterDirection.Input;OPCertApprv.Value= vstrCertApprv; ocmd.Parameters.Add(OPCertApprv);OracleParameterOPStatus=newOracleParameter();OPStatus.Direction=ParameterDirection.Input;OPStatus.Value= vstrStatus; ocmd.Parameters.Add(OPStatus);OracleParameterOPRefCursor=newOracleParameter("OPRefCursor",OracleDbType.RefCursor);OPRefCursor.Direction=ParameterDirection.Output; ocmd.Parameters.Add(OPRefCursor);OracleDataAdapter da =newOracleDataAdapter(ocmd); da.Fill(dsUser);return dsUser;}catch(Exception ex){throw ex;}finally{ oconn.Close();}}
Below is how i add the databale to the DAtaSet.xsd.This datatable is a very plain that i add only column to it without having any connection.
Is there any special configuration required for VS2012? I need the datatable inside Dataset.xsd because i want to use it in reportviewer.
Help Please!!