943,962 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 525
  • C# RSS
May 12th, 2009
0

Error on search button

Expand Post »
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; }
Similar Threads
MJV
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
MJV is offline Offline
66 posts
since Feb 2009
May 13th, 2009
0

Re: Error on search button

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.

C# Syntax (Toggle Plain Text)
  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.
Reputation Points: 69
Solved Threads: 75
Posting Pro in Training
JerryShaw is offline Offline
465 posts
since Nov 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: webservices
Next Thread in C# Forum Timeline: Thread





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC