用VB增加一个信息到SQL数据库
使用下面这个语言可以删除数据库中的信息。但如何在数据库中增加一个信息了? 我尝试了把delete from 改为 insert into,但不行啊!!!Dim db_connection As String = "server=localhost; database=个人收支管理系统;UID=sa; Password=123;Trusted_Connection=false"
Dim conn As New SqlConnection
conn.ConnectionString = db_connection
conn.Open()
Dim data As String
data = InputBox("请输入要删除的用户名:", "输入用户名")
Dim cmd As New SqlCommand
= "delete from 个人收支信息 where 用户名=" & data & ""
cmd.Connection = conn
cmd.ExecuteNonQuery()
MsgBox("已执行数据删除操作!")
conn.Close()