I have a query which return rows with specific fields
SELECT First_Name, Midle_Name, Last_Name, Phone_home, Cell_home, ZipCode_Work, Phone_Work, Cell_Work FROM contact_info WHERE (Last_Name = @Last_Name)
and here is my code to bind this query to datagridview control.
protected void btnSearch_Click(object sender, EventArgs e) { DSSearchTableAdapters.contact_infoTableAdapter LastNameViewAdapter = new DSSearchTableAdapters.contact_infoTableAdapter(); DSSearch.contact_infoDataTable GetByLastName = LastNameViewAdapter.GetDataByLastNameView(txtSearch.Text); GridView1.DataSource = GetByLastName; GridView1.DataBind();
}
the problem that the datagridview will show all the fields in the table not the field I selected.
I'm suing VS 2008,asp.net with C# with mysql Database.
Can you help?
Click on that and it will give you a menu. 
 In the bottom left of the dialogue box is a list of the columns that are in the gridview.  You can select any of the columns in the list and delete them by clicking the red X next to the list. You can also use the up and down arrows to arrange the order of the columns in the gridview.