MySQL .Net Connector / PermissionState

HiI have written a WindowsControlLibrary that needs to connect to MySQL from an aspx page. I need a way to write the following code with the mysql-connector-net-5.1.3new System.Data.SqlClient.SqlClientPermission (PermissionState.Unrestricted).Assert();SqlConnection MSconn = new SqlConnection(MSSQLConn); MSconn.Open();//Do my insert. System.Data.SqlClient.SqlClientPermission.RevertAssert();  The MySql driver does not seem to have the Permissions........ It does have a MyClientFactory  Members which has a CreatePermission method I am just not sure how to work with it.  Any help would be greatly appreciatedThanks 

 

0
michaeltocik
11/2/2007 4:22:43 AM
asp.net.security 27051 articles. 1 followers. Follow

1 Replies
572 Views

Similar Articles

[PageSpeed] 10

michaeltocik:

new System.Data.SqlClient.SqlClientPermission (PermissionState.Unrestricted).Assert();

System.Data.SqlClient.SqlClientPermission.RevertAssert();  

Hi

Base on my understanding, You are trying to create SqlClientPermission for the caller which does not have the required permission type. For the most of web site which is running under medium trust, SqlClientPermission has been set to Unrestricted like this:
                            <IPermission
                                    class="SqlClientPermission"
                                    version="1"
                                    Unrestricted="true"
                            />
And please note that the Assert method may open security vulnerabilities.
What is your MySql connect driver? If you want to connect your MySql database under "medium trust", please have a look at this link.

http://forums.asp.net/p/999456/1324308.aspx#1324308

 


Best Regards
XiaoYong Dai
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
0
XiaoYong
11/5/2007 3:32:40 AM
Reply:

Similar Artilces:

System.Net.Sockets.SocketException with MySQL Connector.NET
Hi. I already tried many things and spent already 2 days without any success. Please help or I'll hang myself.I am using MySql.Data.dll  ver. 5.2.5.0 (runtime v2.0.50727) from my project (library). It works great if i use it from WindowsApplication but once i use it same way in WebApplication, it keeps throwing: The attempted operation is not supported for the type of object referencedException Details: System.Net.Sockets.SocketException: The attempted operation is not supported for the type of object referenced .. AsyncResult ias = socket.BeginConnect(endPoint, null, null);.. (or w...

Net:Net:Net::LDAP::FAQ
------_=_NextPart_001_01C6429F.D89AA417 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, Net::LDAP Net::LDAPS Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, ....) password? I don't like to write the secret password to the perl file. Best regards Barbara Wilbert ------_=_NextPart_001_01C6429F.D89AA417-- Wilbert Barbara (CI/OSI) * wrote: > Hello, > > Net::LDAP > Net::LDAPS > > Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, > ......

.Net Connector 5.0 Encryption vs .Net Connector 5.1 Encryption
Is there any different between the AES Encryption in .Net Connector 5.0 and .Net Connector 5.1 ?? previously i using .Net Connector 5.0 to build my system. the encryption and descryption work fine. but after i upgrade to .Net Connector 5.1 ( uninstall the .Net 5.0 Connector, Install 5.1, delete the "<add assembly="MySql.Data, Version=5.0.7.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>" in webconfig, then add the 5.1 MySQL reference to the system) i cant encrypt the data that i previously decrypt when using .Net Connector 5.0. What is the problem that ca...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

Net Farmers net
Has anyone been able to access any of the tests at http://suicide.netfarmers.net ? I can get the default page but none of the tests appear to be operating over the last several weeks. -- CK I just tested and works as usual!!!Every session TCP_error,because my Shields_guard is intact<<G>> -- Regard: Joh@nnes� 1216771 Ont.Inc. "Nothing is more damaging to a new truth than an old error" "CK" <ckphalon@lascenltd.com> wrote in message news:9i45gg$1qa9$1@news.grc.com... : Has anyone been able to access any of the tests at : http://suicide...

ADO.NET MySql Connector
I am having an issue with parameterized queries. I am using the .NET connector. Dim connStr As String connStr = "server=localhost;user id=root; password=pwd; database=test; pooling=false" Dim conn As New MySqlConnection(connStr) Dim command As New MySqlCommand("INSERT INTO pictures(name,filename) VALUES (@name,@filename)", conn) command.Parameters.Add("@name", txtName.Text) command.Parameters.Add("@filename", txtFilename.Text) conn.Open() command.ExecuteNonQuery() ...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! Have a look into this links http://en.wikipedia.org/wiki/.NET_Framework http://blogs.msdn.com/mohammadakif/archive/2006/12/03/net-3-0-different-versions-of-the-net-framework.aspx http://www.codeproject.com/aspnet/ComparisonASP1xASP20.aspAshok Rajawww.iGold.inDon't forget to click "Mark as Answer" on the post that helped you. This credits that m...

Which mySql connector for which .NET version
Hi all,I couldn't find out which connectors target which .net versions. I have tried http://dev.mysql.com/downloads/connector/ but could not see which are meant to target which .NET versions.Thanks for your time.  http://dev.mysql.com/downloads/connector/net/5.2.htmlI guess this connector is backward compatible too, like the Oracle's.. So you may not have any issues Kumar Reddi As I understand it, you have the following: 5.2 is intended for VS 2008/.NET 3.5 5.1 is intended for VS 2005/.NET 2.0 as well as the Compact Framework 2.0 5.0 is unclear though it is appare...

To .NET or not .NET, that is the question
I'm running WinXP pro 32-bit, meaning I've got the version 1-dot-something of .NET that XP came with. I've been looking for various softwares, and more and more often come across .NET version 2 being prerequisite. No urgency for me re. my questions to this group - so far I have just decided to hit the red X on those download pages - but the desire for this newer version of .NET seems to be growing for me. Firstly, according to my (limited) research, newer .NET versions are inclusive of the previous ones, and the current version seems to be 3.5. So if I go for i...

MySql Connector .NET and the DbProviderFactory
Hi there... I have downloaded the MySql Connector .NET form www.mysql.com . My connectionstring uses the MySql.Data.MySqlClient provider. When i use the DbProviderFactiry to create connections, readers and so on, it comes up with and error, saying that the provider has not been installed proberly... What is the proper way? If i don't use the DbProviderFactiry, and use the MySql Connector .NET like this:             MySqlDataReader reader = null;             try  &n...

net send in .net
Hi,  I am trying to execute net send comman in my vb.net code. But I am getting "win32 exception unhandled error". Please help me. My code is:Dim psi As New ProcessStartInfo() psi.UseShellExecute = False psi.FileName = "Net send" 'xxx.xxx.xx.xx  - IP address of a system in my network psi.Arguments = "xxx.xxx.xx.xx test" Process.Start(psi)  Thanks in advance! Shwetha Tryu changing   psi.FileName = "Net send" 'xxx.xxx.xx.xx  - IP address of a system in my network psi.Arguments = "xxx.xxx.xx.xx test&quo...

converting to vb.net from c#.net authorize.net
authorize.net offered me some sample code when I signed up with them the only problem is the sample code is in c#.net but my page that they type all of their credit card into is vb.net <code><%@ Import Namespace="System.Net" %> <%@ Import Namespace="System.IO" %> <script language="C#" runat="server"> void Page_Load(Object Src, EventArgs E) { myPage.Text = readHtmlPage("https://certification.authorize.net/gateway/transact.dll"); } private String readHtmlPage(string url) { ...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0 #2
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! There are too many differences for one email - - from 1.0 to 1.1 (not a whole lot of real change, other than fixes, at least compared to 1.1 to 2.0) With 2.0, there were many new declarative controls, with many new ideas added in With 3.0, it's a superset of 2.0 - instead of replacing the installation completely, it just 'added on' new functionality - I would...

vb.net vs c#.net vs j#.net
just out of curiousity which looks, acts most like java? i'm still learning trying to used to vb.net but it seems that it was easier to do some stuff with java. C# is Java++ in my opinion. If you have done C or Jave you will prefer C#.Mike Schellenberger - MCAD If you are looking for language similar to java go for J#. However most code samples you find on the net will be in VB.NET and C#....

Web resources about - MySQL .Net Connector / PermissionState - asp.net.security

Errata
Scale agility faster by taking our expert coaching, training and eLearning in Agile, Lean, Extreme Programming and Agile Project Management

Resources last updated: 1/14/2016 8:25:00 PM