ADO.NET的问题
在VS2005里的website想要通过一个程序向数据库新增数据,请问这个代码有什么问题Partial Class AddNew
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As String = "Server=locost;database=Plant;Integrated Security=SSPI"
Dim myconn = New System.Data.SqlClient.SqlConnection()
myconn.ConnectionString = (con)
myconn.open()
Dim sqlcmd As Data.SqlClient.SqlCommand = New Data.SqlClient.SqlCommand()
sqlcmd.Connection = myconn
= "insert into values('TextBox1.Text') "
sqlcmd.ExecuteNonQuery()
sqlcmd.Dispose()
myconn.close()
End Sub
End Class