Click here to Skip to main content
15,892,965 members

Comments by Azzam Alrandi (Top 4 by date)

Azzam Alrandi 30-Sep-14 2:24am View    
Yes , When i show in the content of the dtt table it appears wit the updated columns
they told me that i can't change the structure of the database at the runtime is this true ?
this is what i have tried lately

SqlCommandBuilder cmnd;
private void button1_Click_1(object sender, EventArgs e)
{
ReportViewer AA = new ReportViewer { Dock = DockStyle.Fill };
this.Controls.Add(AA);
BindingSource source = new BindingSource();
SqlConnection con = new SqlConnection(conString);
con.Open();

SqlDataAdapter zz = new SqlDataAdapter(@"SELECT * FROM tbl_Bank", con);

DataSet Da = new DataSet();

zz.Fill(Da);


dsc = new SqlCommandBuilder(zz);

ReportDataSource reportDataSource = new ReportDataSource();
// Must match the DataSource in the RDLC
reportDataSource.Name = "Report";
reportDataSource.Value = Da.Tables[0];

zz.Update(Da);
Adapter.Update(Da);
AA.Reset();
AA.ProcessingMode = ProcessingMode.Local;
AA.LocalReport.ReportPath = AppDomain.CurrentDomain.BaseDirectory + "Report1.rdlc";
AA.LocalReport.DataSources.Add(reportDataSource) ;

AA.LocalReport.DataSources.Add(reportDataSource);

AA.RefreshReport();



}
If I could Send you the whole project at your email that would be perfect , Do you mind ?
Azzam Alrandi 29-Sep-14 7:14am View    
Hello Leena Thank you again for your time
I understand the problem , but still dont know how to start solving it
here is the code
{this.tbl_bankTableAdapter.Fill(this.dataSet1.tbl_bank);
this.reportViewer1.RefreshReport();}
This code is generated automatically by the program itself
i tried
{
//(be advised that "ya" is the name if instant class for form1 which contains the modifying process )

conString = Properties.Settings.Default.BankConnectionString;

SqlConnection con = new SqlConnection(conString);


con.Open();
SqlDataAdapter Adapter = new SqlDataAdapter(@"SELECT * FROM tbl_Bank", con);

System.Data. DataTable dtt = new System.Data.DataTable();
Adapter.Fill(dtt);

Adapter.Fill(ya.bankDataSet);
ya.tblbankBindingSource.DataSource = dtt;


con.Close();
this.reportViewer1.RefreshReport();

}

Azzam Alrandi 29-Sep-14 4:52am View    
I have tried manythings
some of the post here and on another sites, one of them was converting the report to xml file to modify it and bind it with the data source , this is does not work with me due to lack of the information about doing this , another post was a whole project that does this but could not understand how to connect or to modify it or at least understand the concept since i am not professional developer
here is the link for the project it's on this great site

http://www.codeproject.com/Articles/705248/Generating-RDLC-Dynamically-for-the-Report-Viewer
Azzam Alrandi 29-Sep-14 4:47am View    
First Of All Thank you for replying,
secondly have you tried this ?
I am sure that i am updating the data, ( not sure if it's the same database, or i am updating the dataset ), However when i reopen the application , the modified data appear which means that the data is updated , well if you have tried this would you illustrate more
Best Wishes