Welcome, Guest [LogIn] / [Register] / [Forgot Password ?]
Home > Technical Tips > ASP.Net > Create dyanmic search in asp.net ?
Create dyanmic search in asp.net ?
Posted by Saurabh Kumar on Wednesday, Dec 16, 2009
| More

How to create search in webpage and retive data from MSSql.

First You open ASP.net and MSSQL on your system.

Step 1) First you create table and store information you want to search from Sql Server.

Search Text in SqlServer table

Step 2) In step first of Asp.net you drag a control on webpage just like Textbox, Button, GridView.

Control on web page for creating search page

step 3) then connect the datagrid to database through sqldatasource.

Connect Asp.net to SqlServer through SqlDataSource

step 4) fist you choose data source.

Select DataSource and Provider in ASP.net

step 5) then you fill the all connecting information in field.

Fill Information of MSSQL

step 6) after this a show the all field name and table name from database.

Show All Field name from MSSql

step 7) you choose field which you are using in this search

Select Colume for display on webpage

step 8) after selecting field then click "where" button for where clause. and fill all informtion you used for search. ex: (Search in = "Heading" Heading is the field name of sql table, Operator= "like", Source = "control" because you use a TextBox for search, Then last is controlid ="textbox1" this is textbox name. )

choose colume and oprater for where clause in asp.net

step 9) then you click next button. a new window open you test a statement in this window. just like I write a "BCCI" then click ok button to show a news of "BCCI".


Test Sql Query statement In asp.net

Output of SqlDataSource after test

step 10) then after click finish button. your serch is ready.


After create control on webpage

After this you run a page your search box display in page.

you fill a text and click search then display all serch infomation.


Output of Search page in asp.net

Coding of create search page in asp.net

Add Your Comments/Suggestions :
Name:
Email:
Website:
Your Comments:
 
(required)
(will not be published) (required)


©Copyright 2010 saurabhdeveloper.com