| | |
Error on search button
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2009
Posts: 66
Reputation:
Solved Threads: 0
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; }
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; }
•
•
Join Date: Nov 2006
Posts: 436
Reputation:
Solved Threads: 72
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.
// Jerry
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)
private void findBN_Click(object sender, EventArgs e) { int num; string aFilter = string.Empty; if( !string.IsNullOrEmpty(estfindTB.Text) && Int.TryParse(estfindTB.Text, out num) ) aFilter = "Id="+estfindTB.Text; estimatorDataSet.QuoteCalcHeader["estimateno"].DefaultView.RowFilter = aFilter; }
// Jerry
Last edited by JerryShaw; May 13th, 2009 at 10:46 am.
![]() |
Similar Threads
- Search Button..Plz Help (VB.NET)
- error on search code (ASP.NET)
- Search data Using ajax without press search button?? (JavaScript / DHTML / AJAX)
- HELP! search BUttON! (ASP.NET)
- search record using search button from database (ASP)
- Where, oh where has my search button gone? (DaniWeb Community Feedback)
- help please cannot use search button on ie6 (Web Browsers)
Other Threads in the C# Forum
- Previous Thread: webservices
- Next Thread: Thread
| Thread Tools | Search this Thread |
.net access algorithm array backup barchart bitmap box broadcast c# check checkbox client clock combobox control conversion csharp custom database databasesearch datagrid datagridview datagridviewcheckbox dataset datetime degrees development draganddrop drawing dynamiccreation encryption enum equation excel file form format formatting forms function gdi+ hospitalmanagementsystems httpwebrequest image index input install interface java label list listbox mandelbrot math microsystems mouseclick mysql namevaluepairs operator path photoshop picturebox pixelinversion post powerpacks programming property radians regex remoting resource restore richtextbox server sleep soap socket sql sqlserver statistics stream string table text textbox thread time timer update usercontrol validation visualstudio wait webbrowser windows winforms working wpf xml





