简体   繁体   中英

why is one adapter fill working and not the other?

in the code below if I pass the date ant the account number directly, as shown in the commented out code, the code runs and the report gets populated. If I create two string variables, the population comes back empty. What is the difference? Thanks (It's a button using a calendar and a combobox with account number values, creating a report)

private void btnComputePositionDetails_Click(object sender, EventArgs e)
{         
    string Date = monthCalendarAdv1.Value.ToShortDateString();
    string AcctNumber = comboBoxAdv1.SelectedValue.ToString();
    //  this.SpDealRiskDataTableAdapter.Fill(this.BloombergDataSet.SpDealRiskData, "03/26/2014", "1500");
    this.SpDealRiskDataTableAdapter.Fill(this.BloombergDataSet.SpDealRiskData, Date, AcctNumber );
    this.reportViewer1.RefreshReport();
 }

Please disregard, the watch was actually showing 3/26/2014 vs 03/26/2014. I think that was the issue. I'll ask again if it wasn't . thanks again! This solved the issue: string Date = monthCalendarAdv1.Value.ToString("MM/dd/yyyy");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM