0

I want to connect SQL database from R.Net. I am using R.Net from vb.net.
Is it possible? If it possible how?

Using vb.net i have added some .DLL file (R.Net.dll,RdotNET.dll) which will help to work R.Net and i did some coding to find sum.

code:

Imports RdotNET

Public Class Form1

    Dim engine As REngine
    Dim sum As Double

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)   Handles MyBase.Load

        REngine.SetDllDirectory("@C:\Program Files\R\R-2.12.0\bin\i386")
        engine = REngine.CreateInstance("RDotNet")
        engine.EagerEvaluate("sum<- 5 + 6")
        sum = engine.GetSymbol("sum").AsNumeric.First()
        MessageBox.Show(sum.ToString)

    End Sub

now i need to connect to Sql. i need to read a table data and display it in a my app

sorry for my bad English.

1 Answer 1

4

Writing R code that uses R.NET to call a .NET connection to a SQL database seems like an overcomplicated way of doing things. Unless your use case demands this (edit your question to explain what you are doing), I recommend using one of the many R packages that connect directly to SQL databases. Take a look at dbConnect, RMySQL, RPostgreSQL, RODBC, RSQLite or RpgSQL, depending upon what sort of database it is.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.