473,385 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SQLClientPermission Error

environmnet : VB.NET (.Net 2.0)
I am trying run a windows application from a Network.

While connecting to SQL Server, I get the following error.

Request for the permission of type
'System.Data.SqlClient.SqlClientPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.

My code
-----------------------------------------------------------
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Security
Imports System.Security.Permissions

'Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim cs As String = "User ID=dev;password=password1;Data
Source=w2ks-gfrdev;Initial Catalog=gfr"
Dim CN As New SqlConnection(cs)
CN.Open()

End Sub
End Class
------------------------------------------------------

Any help will be appreciated.

Same code works in .Net 1.1

Jan 13 '06 #1
0 1044

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: mmb | last post by:
hi all i used this below function to connect to sql server 2k private void button1_Click(object sender, System.EventArgs e) { try { SqlClientPermission myPerm = new...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
4
by: António Pinho | last post by:
Hi, I have a big problem with an webpart/assembly. i'm trying to connect to sql server but i get the error "Request for the permission of type System.Data.SqlClient.SqlClientPermission,...
1
by: goc | last post by:
I have a Web Farm, that fetches its database-data from a separate database-server. Today I was forced to go over to .NET 2.0 (since 1.1 can't be installed on Windows Vista x64), and it brought...
0
by: asr_mark | last post by:
I have a class library I built that does numerous functions that everyone here uses. Everything works except for connection to the SQL server and grabbing data. The code works if i put it...
0
by: sumguyb | last post by:
I've written a Windows application using VB and Visual Studio 2005. I've used the Data Application Block in the Microsoft Enterprise Library 2.0 to make all of my SQL calls. The application runs...
1
by: sumguyb | last post by:
I've written a Windows application using VB and Visual Studio 2005. I've used the Data Application Block in the Microsoft Enterprise Library 2.0 to make all of my SQL calls. The application runs...
0
by: JoaquimC | last post by:
Hello all, I've a C# application connecting to a SQL Server 2005 DataBase and it all works well in development ambient. I'm developing with Visual Studio 2005 and i can connect to the DataBase...
0
by: cs_hart | last post by:
I have a vb.net app that runs as a console app. Wen I try to execute this exe from another (vb6) exe, I get a SqlClientPermission exception. I've been reading about .net security (something I am...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.