我正在运行此代码以向我的数据库添加一行,但它无效。
这是我的代码:
Dim SqlConnection1 As New SqlConnection("Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\GlacierDB.mdf;Integrated Security=True")
Dim CommandString1 As String = "INSERT INTO MemberDB VALUES ('1', 'JEET', 'ADDRESSX', 'MALE', '900001234', '10/04/2012', '20/12/2014')"
Dim SqlCommand1 As New SqlCommand(CommandString1, SqlConnection1)
SqlCommand1.Connection.Open()
SqlCommand1.ExecuteNonQuery()
但是当我在服务器资源管理器新命令中运行insert into命令时,它正常工作。任何想法?