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?