I created a middle tier component that produce dataset from database
for sql reporting services but i can not open connection
details:
middle tier component which name is MyReports.dll
using System;
using System.Data;
using Microsoft.ApplicationBlocks.Data;
namespace MyReports
{
public class myData
{
public myData()
{}
public DataSet GetData(string ReportName)
{
DataSet ds = null;
if(ReportName == "Customers")
{
string sqlcommand = "SELECT * FROM Customers";
ds = SqlHelper.ExecuteDataset("Data
Source=(local);Database=Northwind;Trusted_Connecti on=true",CommandType.Text,sqlcommand);
}
return ds;
}
}
}
I also created a Dataset processing extension dll which name is
RSCustomData.dll
using System;
using System.Data;
using System.Collections;
using System.Xml;
using Microsoft.ReportingServices.DataProcessing;
namespace MyCompany.SqlReporting.DataExtension
{
public class CustomData :
Microsoft.ReportingServices.DataProcessing.IDataRe ader
{
private int _fieldCount = 0;
private int _currentRow = 0;
private string _fieldName;
private int _fieldOrdinal;
private Type _fieldType;
private object _fieldValue;
private DataSet _ds = null;
internal CustomData(string ReportName)
{
MyReports.myData mydata = new MyReports.myData();
_ds = mydata.GetData(ReportName);
_currentRow = -1;
}
public bool Read()
{
_currentRow++;
if(_currentRow >= _ds.Tables[0].Rows.Count){
return (false);
}
else
return (true);
}
public int FieldCount{
get{
_fieldCount = _ds.Tables[0].Columns.Count;
return _fieldCount;
}
}
public string GetName(int i)
{
_fieldName = _ds.Tables[0].Columns[i].ColumnName;
return _fieldName;
}
public Type GetFieldType(int i)
{
_fieldType = _ds.Tables[0].Columns[i].DataType;
return _fieldType;
}
public object GetValue(int i)
{
_fieldValue = _ds.Tables[0].Rows[this._currentRow][i];
return _fieldValue;
}
public int GetOrdinal(string name)
{
_fieldOrdinal = _ds.Tables[0].Columns[name].Ordinal;
return _fieldOrdinal;
}
public void Dispose()
{}
}
}
then I added these dll's to ReportServer bin file and ReportDesigner
and I added these tag to RSReportServer.config
in data tag
<Extension Name="MyDataExtension"
Type="MyCompany.SqlReporting.DataExtension,MyCompa ny.SqlReporting.DataExtensions"
/>
same tag to the RSDesigner.config file in the Data tag and designer
tag
Then I added this code policy tags to policy config files
When I try to add new report based on "MyDataExtension" on the report
wizard an error occured that is
"A connection cannot be made to the database. Set and check the
connection string." I am sure the connection string
is correct.
Where am i mistake ?