【C#代码段】asp在数据库加入数据

1 private static string connString = "Server = 127.0.0.1; Database = demoDB; Integrated Security =SSPI" ;

2 using (SqlConnection conn = new SqlConnection(connString))

3             {

4                 conn.Open();

5                               string strSQL = @"INSERT INTO [dbo].[ProjectList]

6                                ([Title],[DepartmenNumber],[ProjectNumber],[Type],[ProductLine])

7                          VALUES

8                                ('" + txtTitle.Text + "','" + txtDepartmenNumber.Text + "','" + txtProjectNumber.Text + "','" + dplType.Text + "','" + dplProductLine.Text + "')";

9               }

 

你可能感兴趣的:(asp)