The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I added a DataBoundGrid control and setup an initial sql select statement for it's data. I'd like to add some functionality to change the sql statement based on a button click. I was browsing through the code and the Adapter has a private member called _commandCollection with my initial sql select statement, but I see no way to access this and change this collection. How can I tell my adapter to start using a different sql select statement?
ADAdministrator Syncfusion Team December 12, 2007 12:26 PM UTC
You might try setting the DataAdapter.SelectCommand property if you are querying the same DataTable that is the grid's DataSource. private void button1_Click(object sender, EventArgs e) { string connString = @"Provider=Microsoft.JET.OLEDB.4.0;data source=" + GetPath(@"Datawind.mdb"); string sqlString = "SELECT EmployeeID, FirstName, LastName, Photo, Photo as Photo1 FROM Employees where [LastName] LIKE 'King'";
OleDbConnection connection = new OleDbConnection(connString);
this.dataAdapter.SelectCommand = new OleDbCommand(sqlString, connection); this._dataSet.Tables["Employees"].Clear(); this.dataAdapter.Fill(_dataSet, "Employees"); connection.Close();