Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 23, 2013 04:28 PM by Afzaal.Ahmad.Zeeshan
Jan 22, 2013 12:44 PM|LINK
I have a table with some list of columns, I want to display some of those columns.
Could some one tell me how can I diaplay user search results on ASP.NET page.
Jan 22, 2013 01:31 PM|LINK
You may want to try the tutorials found on this site or you could try this
Jan 23, 2013 07:49 AM|LINK
Private Sub BindGridView()
Using conn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("DatabaseName"))
Dim strSelectCmd As String = "SELECT LastName,FirstName FROM List"
Dim OleDBC As New OleDb.OleDbCommand(strSelectCmd, conn)
ListofCSOAccredited.DataSource = CSOAccredited()
ListofCSOAccredited.DataSourceID = Nothing
Jan 23, 2013 08:29 AM|LINK
you can create a view in database with the columns you want and then return the results from parameterised stored procedure which should return the results from view based on the search criteria passed.
Databind the gridview in asp with simle bound columns.
A simple example of gridview ->
Jan 23, 2013 04:28 PM|LINK
You have learnt SQL so now the thing is to select only some columns.
Lets assume you have 5 cols. col_1, col_2, col_3, col_4, col_5 You need to select only 1, 3 and 5 So here is the SQL statement.
"SELECT col_1, col_3, col_5 FROM Table"; // Table will be the name of the table. And if any condition.
// Than use WHERE clause too.
And the search results will be the ones matching. I guess you need to search the Database. Ok, you need this code for that
"SELECT col_1, col_3, col_5 FROM Table WHERE name LIKE '%a'";
// This will search every word starting with a you can see a "%" sign in start. Telling server to search
// Words that start with a. Now you will get the result of col_1, col_3, col_5 only where the words match.
// To show them in a webgrid. Use some table !
Because I am not able to help you in WebGrid. Accept my sincere apologies for that!