I have this little piece of code that works find on my computer. Then when I upload it to my work computer, on a network it fails. Both have SQL 2000 server.
This is the code:
Dim c As String = Me.TextBox1.Text.ToString
Dim conn As New SqlConnection(c)
Dim cmd As SqlCommand = New SqlCommand("select * from " & Me.TextBox2.Text.ToString, conn)
cmd.CommandType = CommandType.Text
Dim reader As SqlDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
the connection string is this -
"Data Source=(local);Initial Catalog=AhavaOrder;Integrated Security=True"
The error is very long, but this seems to be the main part
System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=184.108.40.206, Culture=neutral,
The type of the first permission that failed was:
Can anyone explain to me what is going on here? I must have overlooked something big.