Subject: MVC Controllerdan Web Forma Veri Gönderme
Posted: 10 Nisan 2020 at 14:23
public DataTable Sorgu_PuanCetveli()
{
baglanti2.Open();
SqlDataAdapter adap = new SqlDataAdapter("select * from TakimTurnuvaPuanCetveliView", baglanti2);
DataTable tbl3 = new DataTable();
adap.Fill(tbl3);
baglanti2.Close();
Response.Redirect("TakimTurnuvaAnaSayfa.aspx");
return tbl3;
}
public DataTable Sorgu_MusabakaSonuclari()
{
baglanti2.Open();
SqlDataAdapter adap = new SqlDataAdapter("select * from MusabakaSonuclariView", baglanti2);
DataTable tbl3 = new DataTable();
adap.Fill(tbl3);
baglanti2.Close();
return tbl3;}
public DataTable Sorgu_Fikstur()
{
baglanti2.Open();
SqlDataAdapter adap = new SqlDataAdapter("select * from TakimTurnuvaFiksturView", baglanti2);
DataTable tbl3 = new DataTable();
adap.Fill(tbl3);
baglanti2.Close(); return tbl3;} void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SQL_Takimlar baglanti = new SQL_Takimlar(); ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/RPTReports/TakımTurnuvaReport.rdlc"); ReportViewer1.LocalReport.DataSources.Clear(); ReportDataSource rdc1 = new ReportDataSource("MasTesDBPuanCetveliDataSet", baglanti.Sorgu_PuanCetveli()); ReportDataSource rdc2 = new ReportDataSource("MasTesDB_MusabakaSonuclariDataset", baglanti.Sorgu_MusabakaSonuclari()); ReportDataSource rdc3 = new ReportDataSource("MasTesDBFiksturDataSet", baglanti.Sorgu_Fikstur()); ReportViewer1.LocalReport.DataSources.Add(rdc1); ReportViewer1.LocalReport.DataSources.Add(rdc2); ReportViewer1.LocalReport.DataSources.Add(rdc3); ReportViewer1.LocalReport.Refresh(); ReportViewer1.AsyncRendering = false; } }