Data Processing Extension to connect to a database and call a Stored Procedure

I am implementing a data processing extension to connect a database and call a stored procedure. But when i am using that extension in the report designer i am getting a error "Unable to connect to data source DPE. The method or operation is not implemented." This was written in C# code and i am new to it. i am using sqlserver2014, visual studio 2013 and .Net framework 2.0

Can anyone help Please.

Here is my code:

namespace DataBaseDPE
{
    public class DBConnection:IDbConnection
    {
        private string mconnstring;
        private string localname = "Database Connection";

        public DBConnection()
        {
            Debug.WriteLine("DataSetConnection: Default Constructor");
        }
        public DBConnection(string Dconnection)
        {
            Debug.WriteLine("DataSetConnection Constructor overloaded with Connection String ");
            mconnstring = Dconnection;

        }

        public IDbTransaction BeginTransaction()
        {
            throw new NotImplementedException();
        }

        public void Close()
        {
            throw new NotImplementedException();
        }

        public string ConnectionString
        {
            get
            {
                return mconnstring;
                
            }
            set
            {
                mconnstring = value;
            }
        }

        public int ConnectionTimeout
        {
            get { throw new NotImplementedException(); }
        }

        public IDbCommand CreateCommand()
        {
            return new DBCommand(this);
        }

        public void Open()
        {
            throw new NotImplementedException();
        }

        public void Dispose()
        {
            
        }

        public string LocalizedName
        {
            get 
            { 
                return localname; 
            }
            set 
            { 
                localname = value; 
            }
        }

        public void SetConfiguration(string configuration)
        {
            try
            {
                SqlConnection sqlconn = new SqlConnection("Data Source=localhost;Initial Catalog=AdventureWorks2000;Integrated Security=SSPI");
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, null);
            }
        }
    }

}
namespace DataBaseDPE
{
    public class DBCommand:IDbCommand
    {
        DBConnection mconnection = null;
        public DBCommand()
        {
            
        }
        public DBCommand(DBConnection aConnection)
        {
            mconnection = aConnection;
        }
        
        public void Cancel()
        {
            throw new NotImplementedException();
        }

        public string CommandText
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public int CommandTimeout
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public CommandType CommandType
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public IDataParameter CreateParameter()
        {
            throw new NotImplementedException();
        }

        public IDataReader ExecuteReader(CommandBehavior behavior)
        {
            throw new NotImplementedException();
        }

        public IDataParameterCollection Parameters
        {
            get { throw new NotImplementedException(); }
        }

        public IDbTransaction Transaction
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public void Dispose()
        {
            throw new NotImplementedException();
        }
    }
}
namespace DataBaseDPE
{
    public class DBDataReader:Microsoft.ReportingServices.DataProcessing.IDataReader
    {
        private SqlConnection mSql = null;
        private System.Data.DataTable mDataTable = new System.Data.DataTable("ReportTable");
        private SqlCommand msqlcmd = null;
        //private SqlDataReader mreader = null;
        //private SqlDataAdapter madapter = null;
        
        internal DBDataReader(SqlConnection aSql)
        {
            string conn = "Data Source=localhost;Initial Catalog=AdventureWorks2000;Integrated Security=SSPI";
            mSql = new SqlConnection(conn);
        }
        internal DBDataReader(DBConnection aConnection, SqlConnection aSql, SqlCommand asqlcmd, SqlDataReader areader)
        {
            asqlcmd=msqlcmd;
            aSql=mSql;
            msqlcmd=new SqlCommand("Exec SampleSP",mSql);
           mSql.Open();
           SqlDataReader mreader = msqlcmd.ExecuteReader();
           mreader.Close();
           this.mSql.Close();
        //}
           //internal DBDataReader(DBConnection aConnection, SqlConnection aSql, SqlCommand asqlcmd, SqlDataReader areader);
           //{   
           asqlcmd = msqlcmd;
           aSql = mSql;
           areader = mreader;
            
        //    internal DBDataReader(SqlDataReader areader, ArrayList rowlist)
        //    {
                               
                SqlCommand SPCmd=new SqlCommand("SampleSP", mSql);
                SPCmd.CommandType=System.Data.CommandType.StoredProcedure;
                SqlDataReader reader=SPCmd.ExecuteReader();
                mSql.Open();
                ArrayList rowlist = new ArrayList();
                while(reader.Read())
                {
                object[] values = new object[reader.FieldCount];
             
                reader.GetValues(values);
                rowlist.Add(values);
                }
            //}
            //internal DBDataReader(SqlDataAdapter madapter)
            //{

                SqlDataAdapter adapter = new SqlDataAdapter();
                DataSet ds = new DataSet();
                adapter.Fill(ds);
            }

                      
            
        //internal void GetTable(DBDataReader aReader)
        //{
            
        //}

        public int FieldCount
        {
            get { throw new NotImplementedException(); }
        }

        public Type GetFieldType(int fieldIndex)
        {
            throw new NotImplementedException();
        }

        public string GetName(int fieldIndex)
        {
            throw new NotImplementedException();
        }

        public int GetOrdinal(string fieldName)
        {
            throw new NotImplementedException();
        }

        public object GetValue(int fieldIndex)
        {
            throw new NotImplementedException();
        }

        public bool Read()
        {
            throw new NotImplementedException();
        }

        public void Dispose()
        {
            throw new NotImplementedException();
        }
    }
}

April 27th, 2015 1:18pm

Hi Prabha2233,
 
Thank you for your question. 

I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 

Thank you for your understanding and support.

Best regards,
Qiuyun Yu

Free Windows Admin Tool Kit Click here and download it now
April 28th, 2015 8:15am

Hi Prabha,


     perspective to further analize this issue is really beyond
     what we can do here in the forums. If you cannot determine your answer
     here or on your own, consider opening a support case with us. Visit this
     link to see the various support options that are available to better meet
     your needs: 
http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone."



July 24th, 2015 1:32am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics