Postagens

Mostrando postagens de 2018

SOLVED MySQL connector with ENTITY FRAMEWORK WORKING in Medium Trust hosting environments

Imagem
First I'm going to show you how I finally used the Entity Framework in a  Shared Web Hosting Trust Level . And at the end, I will let off the things I worked so hard. My environment: Mysql version was something 5.6.35-81.0-log .NET framework 4.0 Visual Studio Community 2017 Shared Web Hosting Trust Level = Medium Follow the steps to you finally publish successfully your application: Install the  mysql-connector-net-6.3.9 ( download ) Install the  mysql-for-visualstudio-1.2.8   ( download ) Reference the 4 mysql dlls in your project mysql.data.dll ( download ) mysql.data.entity.dll ( download ) mysql.visualstudio.dll ( download ) mysql.web.dll ( download ) Go to your project Properties > AssemblyInfo.cs and add the 2 assemblies: [assembly: SecurityRules(SecurityRuleSet.Level1)] [assembly: System.Security.AllowPartiallyTrustedCallers] Make sure your webconfig file has the following lines: <system.data>     <DbProviderFactories>       <c

JAVA Como ler um objeto JSON ARRAY ou como converter uma linha de JSON ARRAY em JSONOBJECT

Imagem
JAVA Como ler um objeto JSON ARRAY ou como converter uma linha de JSON ARRAY em JSONOBJECT final JSONArray geodata = response.getJSONArray( "result" ); final int n = geodata.length(); for ( int i = 0 ; i < n; ++i) { final JSONObject person = geodata.getJSONObject(i); //System.out.println(person.getInt("id")); repoName = person.getString( "Name" ); //System.out.println(person.getString("gender")); //System.out.println(person.getDouble("latitude")); //System.out.println(person.getDouble("longitude")); } note que o geodata do tipo JSONARRAY recebe um JSON ARRAY. Nisso basta ler todas as propriedas e pelo .getString voce conseguira ler a propriedade desejada.