(一)数据绑定、ListBox、DataGrid SQLServer基础、SQLServer使用主键策略

 

(二)DataReader、DataSet、参数化查询、防注入漏洞攻击、SQLHelper

用户界面中进行登录判断。输错三次禁止登陆(半小时),用数据库记录ErrorTimes。 数据导入:从文本文件导入用户信息。易错点:Parameter的重复添加。File.ReadAllLines() 数据导出:将用户信息导出到文本文件。File.WriteAllLines()

省市联动选择 手机号码归属地查询

 1 using System;
 2 using System.Collections.Generic;
 3 using System.ComponentModel;
 4 using System.Data;
 5 using System.Drawing;
 6 using System.Linq;
 7 using System.Text;
 8 using System.Windows.Forms;
 9 using System.Data.SqlClient;
10 
11 namespace adonet
12 {
13     public partial class Form1 : Form
14     {
15         public Form1()
16         {
17             InitializeComponent();
18         }
19 
20         private void button1_Click(object sender, EventArgs e)
21         {
22             SqlHelper.ExecuteNonQuery("insert into T_Student(Name,Age) values('a',33)");
23             DataTable table = SqlHelper.ExecuteDataTable("select * from T_Student where Age=@Age or Name=@Name",
24                 new SqlParameter("@Age", 26), new SqlParameter("name", "刘洋"));
25             foreach (DataRow row in table.Rows)
26             {
27                 string name = (string)row["name"];
28                 MessageBox.Show(name);
29             }
30         }
31     }
32 }
View Code

相关文章:

  • 2021-06-24
  • 2021-11-30
  • 2021-12-11
  • 2021-05-23
  • 2022-01-26
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
猜你喜欢
  • 2022-02-10
  • 2022-01-07
  • 2022-12-23
  • 2022-02-10
  • 2021-07-12
  • 2022-02-13
  • 2022-02-10
相关资源
相似解决方案