Asp.net SQL Server 2008 search function and fixed time

I have a question:

I want to make a search function in my asp.net project! I am using a 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 row of tables for the searched word?

If I search for an ID code, it will display the entire string with Name,Age,ID .

I could not find a way to do this.

Also

I would like to know how can I set a fixed time for a SQL Server database? I do not want to receive pc time / date because it can be changed.

thanks

+4
source share
2 answers

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 for your sql database, you should use the following:

 SELECT getdate() 

This gets the time of the server on which the database sits.

If this does not answer your question, please provide more detailed information and features.

0
source
0
source

Source: https://habr.com/ru/post/1399403/


All Articles