'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error
Go Back  Xtreme Visual Basic Talk > > > 'System.Security.SecurityException' - Error


Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2005, 03:25 AM
noccy noccy is offline
Contributor
 
Join Date: Jun 2003
Location: Oslo, Norway
Posts: 602
Default 'System.Security.SecurityException' - Error


Hello!

I use the following code to populate a datagrid:

Code:
Dim cnn As SqlClient.SqlConnection = New SqlClient.SqlConnection("Data Source=PC60380\VSDOTNET; Initial Catalog=TrafikkdataTest_;user id=*****;password=******") Dim cmd As New SqlClient.SqlCommand() Dim da As New SqlClient.SqlDataAdapter() Dim ds As New DataSet() cmd = cnn.CreateCommand cmd.CommandText = "SELECT * FROM tblBrukere WHERE Bruker LIKE 'test'" da.SelectCommand = cmd da.Fill(ds, "tblBrukere") dg1.DataSource = ds dg1.DataMember = "tblBrukere"

This gives med the following errors:

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

A first chance exception of type 'System.Security.SecurityException'
occurred in System.Data.dll


Does anyone know what might cause this?

noccy
Reply With Quote
  #2  
Old 01-14-2005, 03:48 PM
MKoslof's Avatar
MKoslof'System.Security.SecurityException' - Error MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Have you verified that you have permissions on this database? Can you get this database and run queries via the Enterprise manager?
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error 'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error
 
'System.Security.SecurityException' - Error
'System.Security.SecurityException' - Error
 
-->