ALWilliams
Programmer
I'm trying to code a small app where it connects to a remote SQL server 2005 Express database and return some values and display that onto the form.
I have managed to get the code to connect to the database (well it never raised any errors) - but when I actually try to do anything I get a security error.
The code in question is:
Dim accountsQuery As String = "Select * From Alpha" Dim cnn1 As New SqlConnection("Data Source=<SERVERNAME>\SQLEXPRESS; ;User ID=<USERNAME>;password=<PASSWORD>;DATABASE=<MYDBNAME>;Integrated Security=False;User Instance=True")
NewAccountDataset = New DataSet
newAccountTableAdapter = New SqlDataAdapter(accountsQuery, cnn1)
newAccountTableAdapter.Fill(NewAccountDataset, "accounts")
upon it getting to the last line it errors with the following reply:
Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Any ideas much appreciated.
I have managed to get the code to connect to the database (well it never raised any errors) - but when I actually try to do anything I get a security error.
The code in question is:
Dim accountsQuery As String = "Select * From Alpha" Dim cnn1 As New SqlConnection("Data Source=<SERVERNAME>\SQLEXPRESS; ;User ID=<USERNAME>;password=<PASSWORD>;DATABASE=<MYDBNAME>;Integrated Security=False;User Instance=True")
NewAccountDataset = New DataSet
newAccountTableAdapter = New SqlDataAdapter(accountsQuery, cnn1)
newAccountTableAdapter.Fill(NewAccountDataset, "accounts")
upon it getting to the last line it errors with the following reply:
Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Any ideas much appreciated.