Posted on 2006-05-08
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=18.104.22.168, 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.