【发布时间】:2014-02-06 03:18:03
【问题描述】:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myconnection As SqlConnection
Dim mycommand As SqlCommand
Dim ra As Integer
myconnection = New SqlConnection("server=IAI-004;uid=;pwd=;database=payroll")
myconnection.Open()
mycommand = New SqlCommand("INSERT INTO employee_info([employee_id],[first_name],[last_name],[middle_name],[email],[telephone],[gender],[status],[date_birth],[hire_date]) values ('" & Employee_idTextBox.Text & "','" & First_nameTextBox.Text & "','" & Last_nameTextBox.Text & "','" & Middle_nameTextBox.Text & "','" & EmailTextBox.Text & "','" & TelephoneTextBox.Text & "','" & GenderTextBox.Text & "','" & StatusTextBox.Text & "','" & Date_birthDateTimePicker.Text & "','" & Hire_dateDateTimePicker.Text & "')", myconnection)
mycommand.ExecuteNonQuery()
MessageBox.Show("New Row Inserted" & ra)
myconnection.Close()
End Sub
对对象“employee_info”、数据库“payroll”架构 dbo 的 INSERT 权限被拒绝
我该如何解决这个问题?
【问题讨论】:
标签: sql-server sql-server-2005 vb.net-2010