简体   繁体   中英

Search Function asp.net SQL Server 2008 and fixed time

I have a question :

I want to make a search function in my asp.net project ! I'm using SQL Server 2008 database.

I have a gridview on my page showing something like this: Name,Age,ID .

How can I make a search function to show the entire line of tables for the term searched?

If I search the ID code, it will show the entire line with name,age,id .

I couldn't find a way to do that.

Also

I would like to know how can I make a fixed time for SQL Server database? I don't want to get pc time / date because it can be changed.

Thanks

One way to search using tsql:

SELECT Name, Age, ID FROM YourTableName
WHERE Name = YourSearchTerm
OR Age = YourSearchTerm
OR ID = YourSearchTerm

To get the time of your sql database you would use the following:

SELECT getdate()

This gets the time of the server that the database is sitting on.

If this doesn't answer your question, please provide more details and specifics.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM