C#nedir?com Homepage
Forum Home Forum Home > ASP.NET > ASP.NET
  New Posts New Posts RSS Feed - MVC Controllerdan Web Forma Veri Gönderme
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MVC Controllerdan Web Forma Veri Gönderme

 Post Reply Post Reply
   

Author
Message
cakewalk View Drop Down
Newbie
Newbie


Joined: 09 Kasım 2014
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote cakewalk Quote  Post ReplyReply Direct Link To This Post Topic: MVC Controllerdan Web Forma Veri Gönderme
    Posted: 10 Nisan 2020 at 14:23
Controllerda oluşturduğum bu 3 datatable' ı web formdaki reportviewer ile ilişkilendirmek ve rdlc göstermek istiyorum.
Aslında şu an çalıştırıyorum fakat datable ı controllerda oluşturup web forma göndermek istiyorum.
Çünkü datayı dropdownlistler ile filtreleyip göstermek isteyebilirim.
 
Bunu nasıl yaparım. Yardımınızı rica ederim.
 
CONTROLLER (cs)

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;}

 
**********************
 
WEB FORM (aspx.)

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;

}

}

 

 

 

 

 

 

 

Back to Top
 Post Reply Post Reply
  Share Topic   
   


Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.