Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Cannot connect to database programatically

$
0
0

Sorry for the formatting, here is my code (I guess I can't edit?)

var reportSource = new UriReportSource();

reportSource.Uri = @"Reports/MyReport.trdp";

//Uses reportPackager.Unpackage

var reportInstance = UnpackageReport(@"Reports/MyReport.trdp");

var dataSource = new SqlDataSource()

dataSource.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString;<br>            dataSource.ProviderName = "Microsoft.Jet.OLEDB.4.0";

reportInstance.DataSource = dataSource;

// Creates an InstanceReportSource

var instanceReportSource = CreateInstanceReportSource(reportInstance, reportSource);

this.ReportViewer1.ReportSource = instanceReportSource;


Viewing all articles
Browse latest Browse all 78072

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>