Hi,

Looks like you have mixed up Spring XML and .NET config XML.
Moreover, you don't provide any configuration file when starting Ignite
with Ignition.Start();

To work with ODBC from .NET, you have to configure ODBC in a Spring XML
file (NOT app.config) like this:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd";>
<bean id="ignite.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
  <property name="odbcConfiguration">
    <bean class="org.apache.ignite.configuration.OdbcConfiguration"/>
  </property>
</bean></beans>


then provide path to that file Ignition.Start("my-file.xml");

On Tue, Mar 21, 2017 at 7:41 AM, kavitha <kavithamr...@gmail.com> wrote:

> Hi,
>
> My Code in app.config file.
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
>     <startup>
>         <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"
> />
>     </startup>
> <bean id="ignite.cfg"
> class="org.apache.ignite.configuration.IgniteConfiguration">
>
>   <property name="odbcConfiguration">
>     <bean class="org.apache.ignite.configuration.OdbcConfiguration"/>
>   </property>
>
> </bean>
> </configuration>
>
> packages.config file
>
> <?xml version="1.0" encoding="utf-8"?>
> <packages>
>   <package id="Apache.Ignite" version="1.9.0" targetFramework="net45" />
> </packages>
>
> code in class file
>
> class Program
>     {
>         static void Main(string[] args)
>         {
>             IIgnite ignite = Ignition.Start();
>            OdbcConnection con = new OdbcConnection("DRIVER={Apache
> Ignite};ADDRESS=localhost:10800;CACHE=MyCache");
>             con.Open();
>             con.Close();
>         }
>     }
>
> Still I got ERROR [08001] Failed to establish connection with
> the host.
>
> Please tell me how can I resolve this?
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Connection-not-established-tp11303p11331.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Reply via email to