Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Both DataSource and DataSourceID are defined in Gridview1

$
0
0

By the way you guys in this C Forum ROCK.  Other forums may take weeks or months before you get an answer.

I have a problem using C# on a ASp.NET site.

I have a Table Adapter with two queries.  1 to return all projects and the other to return projects on ProjectID parameter.

I use GridViewProject bound to ObjectDataSource1 to return al projects, but have a search textBox with a button on the same page.

I have included in my page_load event some code to do as follows:

if (textBox == "")       // I have used == null to no avail as well.

   GridViewProject.DataSource = myAdapter.GetProjectData();

else

   GridViewProject.DataSource = myAdapter.GetProjectDataByProjectID(textBox);  //textBox = TextBox1.Text

I have already declared my namespace for the ProjectTableAdapters and instantiated the ProjectdataTable  class.    Do anyone have an answer to this???


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>