Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

SQL to Streaming Dataset using VB.net

Hi, 

 

I am trying to create a Streaming dataset in Power BI, where data from SQL server is being pushed. 

 

I have found resources online to achieve this using Power shell. 

 

Is it possible to achieve the same in VB.net?

Appreceate any help!

 

Thanks

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

I don't know much about VB.NET. But this process is roughly divided into two steps:

 

1. Get data from SQL Server using VB.net.

 

Reference: 

How to connect to a database and run a command by using ADO.NET and Visual Basic .NET;

how to access remote sql server database from vb.net windows form application.

 

2. Use VB.net to send an HTTP request to add rows to the Streaming dataset.

 

Reference: 

How to send a POST in .net vb?


 

Option Infer On
Imports System.Net
Imports System.Text


Public Class Test

    Private Sub TESTRUN()
        Dim s As HttpWebRequest
        Dim enc As UTF8Encoding
        Dim postdata As String
        Dim postdatabytes As Byte()
        s = HttpWebRequest.Create("http://www.textmarketer.biz/gateway/")  ---------URL
        enc = New System.Text.UTF8Encoding()
        postdata = "username=*****&password=*****&message=test+message&orig=test&number=447712345678" ------data
        postdatabytes = enc.GetBytes(postdata)
        s.Method = "POST"
        s.ContentType = "application/x-www-form-urlencoded"  
        s.ContentLength = postdatabytes.Length

        Using stream = s.GetRequestStream()
            stream.Write(postdatabytes, 0, postdatabytes.Length)
        End Using
        Dim result = s.GetResponse()
    End Sub
End Class

 


stream.PNG

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Is this problem solved?

 

 

Best Regards,

Icey

Icey
Community Support
Community Support

Hi @Anonymous ,

 

I don't know much about VB.NET. But this process is roughly divided into two steps:

 

1. Get data from SQL Server using VB.net.

 

Reference: 

How to connect to a database and run a command by using ADO.NET and Visual Basic .NET;

how to access remote sql server database from vb.net windows form application.

 

2. Use VB.net to send an HTTP request to add rows to the Streaming dataset.

 

Reference: 

How to send a POST in .net vb?


 

Option Infer On
Imports System.Net
Imports System.Text


Public Class Test

    Private Sub TESTRUN()
        Dim s As HttpWebRequest
        Dim enc As UTF8Encoding
        Dim postdata As String
        Dim postdatabytes As Byte()
        s = HttpWebRequest.Create("http://www.textmarketer.biz/gateway/")  ---------URL
        enc = New System.Text.UTF8Encoding()
        postdata = "username=*****&password=*****&message=test+message&orig=test&number=447712345678" ------data
        postdatabytes = enc.GetBytes(postdata)
        s.Method = "POST"
        s.ContentType = "application/x-www-form-urlencoded"  
        s.ContentLength = postdatabytes.Length

        Using stream = s.GetRequestStream()
            stream.Write(postdatabytes, 0, postdatabytes.Length)
        End Using
        Dim result = s.GetResponse()
    End Sub
End Class

 


stream.PNG

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.