问题
When i enter the id on the textbox of form1.form2 Report viewer shown the record.but it won't displayed all data diplayed what is in the table.
I have create the dataset1 and load the values.
Form1
Form2 frm2 = new Form2();
frm2.studentid = textBox1.Text;
frm2.Show();
Form2
string id = studentid;
this.recordsTableAdapter.FillBy(this.DataSet1.records, id);
// by **this line Gereate sub for by** i am a beginner of Report viewer
this.recordsTableAdapter.Fill(this.DataSet1.records);
this.reportViewer1.RefreshReport();
private string id;
public string studentid
{
get { return id; }
set { id = value; }
}
dataset i wrote the query
SELECT id, firstname, lastname FROM dbo.records where id = ?
回答1:
You are throwing this exception on you method using throw new System.NotImplementedException();
. You need to remove this line and add some logic in here.
public partial class recordsTableAdapter {
internal void FillBy(DataSet1.recordsDataTable recordsDataTable, string id)
{
// Remove exception and do something with your datatable.
}
}
See doc for NotImplementedException
The NotImplementedException exception is thrown when a particular method, get accessor, or set accessor is present as a member of a type but is not implemented.
NotImplementedException uses the default Object.Equals implementation, which supports reference equality. For a list of initial values for an instance of NotImplementedException, see the NotImplementedException constructors.
You might choose to throw a NotImplementedException exception in properties or methods in your own types when the that member is still in development and will only later be implemented in production code. In other words, a NotImplementedException exception should be synonymous with "still in development."
来源:https://stackoverflow.com/questions/59455538/select-id-record-view-by-report-viewer