| | |
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 ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client combobox connection console control conversion csharp custom database datagrid datagridview dataset datetime degrees deployment developer development draganddrop drawing editing encryption enum event excel file form format forms function gdi+ hospitalmanagementinformationsystem httpwebrequest image imageprocessing index input install java label list listbox mandelbrot math mouseclick mysql operator oracle path photoshop picturebox pixelinversion post priviallages. programming radians regex remote remoting richtextbox rows serialization server sleep socket sql statistics stream string table temperature text textbox thread time timer txt update uploadatextfile usercontrol validation visualstudio webbrowser windows windowsformsapplication winforms wpf xml





