Bug #41620 You do not have permissiosn to use blob data
Submitted: 19 Dec 2008 7:02 Modified: 19 Dec 2008 9:58
Reporter: Vamshidhar Taduka Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:am using sql server 2005 OS:Windows (Windows server 2003 & Xp SP2)
Assigned to: CPU Architecture:Any
Tags: You do not have permissiosn to use blob data

[19 Dec 2008 7:02] Vamshidhar Taduka
Description:
I hosted an application in the godaddy.com hosting environment. When i try to insert an image using blobs am getting the following error. You do not have permissions to use blob data. Please do help in resolving the issue. The application is running on IIS 6.0. Using sql server 2005 for  inserting the images.

This is the following code i have used in my file:
 private void insertImage()
    {
        
        string connectionstring = "Data Source=KTREE;Persist Security Info=True;Initial Catalog=Demo;User ID=sa;password=ktree123";
        SqlConnection con = new SqlConnection(connectionstring);
        string path = "d:\\hosting\\emailismail\\kidsplanet\\Temp\\Blue hills.jpg";
        
        string select = "insert into Images(ImageBytes) SELECT BulkColumn FROM OPENROWSET(Bulk '" + path + " ', SINGLE_BLOB) AS BLOB";
        SqlCommand cmd = new SqlCommand(select, con);
        con.Open();
        cmd.ExecuteNonQuery();
    }

when i execute the above code. Iam getting an error:
You do not have permissiosn to use blob data.

Please do reply back me to the following emailid: taduka.vamshi@gmail.com

How to repeat:
This is the following code i have used in my file:
 private void insertImage()
    {
        
        string connectionstring = "Data Source=KTREE;Persist Security Info=True;Initial Catalog=Demo;User ID=sa;password=ktree123";
        SqlConnection con = new SqlConnection(connectionstring);
        string path = "d:\\hosting\\emailismail\\kidsplanet\\Temp\\Blue hills.jpg";
        
        string select = "insert into Images(ImageBytes) SELECT BulkColumn FROM OPENROWSET(Bulk '" + path + " ', SINGLE_BLOB) AS BLOB";
        SqlCommand cmd = new SqlCommand(select, con);
        con.Open();
        cmd.ExecuteNonQuery();
    }

when i execute the above code. Iam getting an error:
You do not have permissiosn to use blob data.
[19 Dec 2008 7:04] Vamshidhar Taduka
Please do help me someone in resolving this issue.
[19 Dec 2008 7:05] Vamshidhar Taduka
This is the file am using. Error

Attachment: InsertImage.aspx.zip (application/x-zip-compressed, text), 799 bytes.

[19 Dec 2008 7:08] Vamshidhar Taduka
I do not have any issue when i run the code on Windows XP SP2 and Windows server 2003. I facing this issue only on godaddy hosting server. Please do send me dll file that i can use for this issue.

Thanks.
[19 Dec 2008 8:59] Valeriy Kravchuk
Can you, please, try to explain how this you problem with IIS and SQL Server 2005 from Microsoft is related to MySQL software?
[19 Dec 2008 9:09] Vamshidhar Taduka
when i reported this error(You do not have permissions to use blob data) to godaddy support guys. they told me to download zip file connector/.net 5.0 version from mysql.com . They told me to edit Assembly.cs and add the code using system.security and in assembly section [assembly: AllowpartiallyTrustedCallers] after saving these, they told me to recompile the dll file and upload to my bin dir in my application. 

I have mentioned the hosting environment. There is nothing to do with IIS 6.0.
[19 Dec 2008 9:58] Tonci Grgin
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.

Explanation:
Vamshidhar, please notice it is not our job to fix your environment nor to teach you how to use security in .NET framework. Please get help on mailing lists or internet as this is definitely not a bug in MySQL SW but in configuration. This error message does not originate from c/NET or MySQL server at all.
Lowering security level, as suggested, hides potential dangers. You should better read about it before changing anything.
As for code, please search BugsDB and manual, you'll find numerous ways to deal with BLOB's. For complete example see my code in Bug#22333 or which ever sample you like.

If you're still persistent on us fixing your environment or doing builds for you, please purchase support contract.

PS: I am puzzled here... You got advice to change AssemblyInfo.cs in MySQL c/NET but you use MSSQL2005... Do you use MySQL SW at all? I don't see it in "The application is running on IIS 6.0. Using sql server 2005 for  inserting the images."