-
Use the Data Adaptor or Data Reader to bind the data you want and display it.
First, you need to introduce a package.
import ;
sqlconnection con=new sqlconnection("data source=;initial catalog=;user id=;password=;");First of all, establish a database connection, ask the database server address, database name, then user, password, various configurations).
string str="select * from table where name='Zhang San' and (filter clause=filter clause)";The query statement you want to execute.
sqlcommand cmd= new sqlcommand(con,str);Create sqlcmd
There are 2 ways to perform SQL queries, use Data Reader or Data Adaptor to check it yourself.
It's more convenient to use a data adaptor here.
A data set and a data adaptor must be defined before use
dataset ds=new dataset();
dataadaptor da=new dataadaptor(cmd);Bound to cmd.
table1");Run the SQL statement and put the returned result set in Table 1 of DS.
Get the returned table and use it as you please.
table1"].[0][0];The data in the first column of the first row is displayed in label1.
table1"] directly displays the returned table in the datagridview.
It seems that there is also a sentence of binding columns, but I don't remember much.
-
select * from [table name] where bbb like'%,1,%' or bbb like '1,%' or bbb like '%,1'
Indicates a wildcard.
There are three possible queries for this storage format.
Case 1: 1 ,...This kind of 1 in the first place, this one matches 1, % Note that the percent sign can match any character.
Scenario 2: ....1,…This 1 is in the middle and this matches %, 1, % case 3: ....1 This kind of 1 is in the end, this kind is matched by 1,%, you already know 1, why are you still taking it out in the database???
-
Do you mean that the information is displayed after submission, or that it is displayed dynamically during the input process.
-
You can do it with an ajax asynchronous request, and when you enter the user and password, you can put the information he entered into the database, query it for information, and then display it.
Landlord Your fault should be here:
now()&"'If you have a SQL database, use gedate(). >>>More
Make a method in the submit button that either it won't be submitted to the database. >>>More
function open conn() defines the function open conndim dbpath, and conn defines the variables dbpath and conndbpath="Database path"Override the relative path of your database to the variable dbpath >>>More
Step 1: Install IIS
Open Control Panel - > Programs Programs and Features - > Turn Windows features on or off, check "Internet Service Information", then "Internet Service Information" - > World Wide Web Services - > Application Development Function, check "Unchecked by default, cannot be published**. After that, confirm the installation. >>>More
With 2 2 points, and 2 22k points, you can solve the problem.