Error on search button

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Feb 2009
Posts: 66
Reputation: MJV is an unknown quantity at this point 
Solved Threads: 0
MJV MJV is offline Offline
Junior Poster in Training

Error on search button

 
0
  #1
May 12th, 2009
I have code that is giving me the following errors

The best overloaded method match for 'EstimatorC.EstimatorDataSet.QuoteCalcHeaderDataTable.this[int]' has some invalid arguments E:\VisualStudioProjects\EstimatorC\EstimatorC\Estimate.cs 1653 13 EstimatorCArgument '1': cannot convert from 'string' to 'int' E:\VisualStudioProjects\EstimatorC\EstimatorC\Estimate.cs 1653 46 EstimatorC


Code:

private void findBN_Click(object sender, EventArgs e)
{ string aFilter = "";
////Search name starts with
aFilter = "Id=" + estfindTB.Text;
////Create the filter string.
if (estfindTB.Text.Trim() == "")
{ aFilter = ""; }
else
{ aFilter = aFilter; }
////Apply the filter.
estimatorDataSet.QuoteCalcHeader["estimateno"].DefaultView.RowFilter = aFilter; }
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 436
Reputation: JerryShaw is on a distinguished road 
Solved Threads: 72
JerryShaw JerryShaw is offline Offline
Posting Pro in Training

Re: Error on search button

 
0
  #2
May 13th, 2009
estimatorDataSet.QuoteCalcHeader["estimateno"]. <<== is estimateno correct ? does the QuoteCalcHeader accept a string as the indexer ?
What is QuoteCalcHeader ? (Type?)

You can ignore the code below, I think your problem is with indexing that QuoteCalcHeader object, but the formatting below might help you after resolving that issue, so I left it in this response.

  1. private void findBN_Click(object sender, EventArgs e)
  2. {
  3. int num;
  4. string aFilter = string.Empty;
  5. if( !string.IsNullOrEmpty(estfindTB.Text) && Int.TryParse(estfindTB.Text, out num) )
  6. aFilter = "Id="+estfindTB.Text;
  7. estimatorDataSet.QuoteCalcHeader["estimateno"].DefaultView.RowFilter = aFilter; }

// Jerry
Last edited by JerryShaw; May 13th, 2009 at 10:46 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC