How to use Flutter + MSSQL Database?

18,958 views
Skip to first unread message

Alfredo Zanoni

unread,
Mar 2, 2018, 9:00:35 AM3/2/18
to Flutter Dev
Hi, 

I want to connect yo my local MSSQL Database, its posible? because https://github.com/tekartik/sqflite only allow to read ".db" files, I want to open a connection.

Regards.-

Martin Rybak

unread,
Mar 2, 2018, 3:35:38 PM3/2/18
to Flutter Dev
On Android you could use http://jtds.sourceforge.net, and on iOS you could use https://github.com/martinrybak/SQLClient.

You would have to use a platform channel to call them from Flutter, but it should work.

Martin

Alfredo Zanoni

unread,
Mar 2, 2018, 3:40:28 PM3/2/18
to Flutter Dev
Thans for the help, but how can do that in flutter? step by step, I come here thinking that "Flutter" would be easy to use, with 2 or 3 clicks and less programming...so I wait that would be easy to implement a simple SELECT * FROM XXX and show the results on both devices (IOS and Android) with Flutter.

But for now I didn see that =/

Martin Rybak

unread,
Mar 3, 2018, 5:36:52 AM3/3/18
to Flutter Dev
No need to get discouraged. To be fair, what you are asking for has always been hard on mobile. If SQL server access is what you want, take a look at Xamarin, which provides a built-in way to access to SQL Server:


However if you are intending to access your database over the public internet I would strongly suggest you not do this, and expose your data via an API instead. Then you can can easily use Flutter :)

Martin

Abner Hernandez

unread,
Mar 5, 2018, 8:42:19 PM3/5/18
to Martin Rybak, Flutter Dev
Hello, I am doing a good job thanks to flutter.
Hey it is possible to connect to MSSQL Server using a Middleware API on your local machine.
How? Well: First, you need a SQLServerSocket: https://github.com/nippur72/SqlServerSocket is free and works!
Second: you need a client https://github.com/nippur72/SqlServerSocket (look DartClient folder).
I did several connections and it works very well.

Of course, it is not as "easy to use, with 2 or 3 clicks and less programming..." but yes, you can "implement a simple SELECT * FROM XXX and show the results on both devices (IOS and Android) with Flutter." I did it.!

Let me know if you need more help.



--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

charles...@gmail.com

unread,
Sep 15, 2018, 8:39:11 AM9/15/18
to Flutter Dev
Hi Abner,

I want to try to connect SQL  server from flutter by using your approach. but I did not find the SqlServerSocket.exe file in your github.

Could you tell me how to set up in the backend server. Thanks a lot

Regards Charles

rasik nizam

unread,
Mar 8, 2019, 1:54:31 AM3/8/19
to Flutter Dev
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.

Gopal Jangid

unread,
Jun 20, 2019, 2:23:06 PM6/20/19
to Flutter Development (flutter-dev)
@Abner Hernandez

Please give some example code
It will be helpful
To unsubscribe from this group and stop receiving emails from it, send an email to flutt...@googlegroups.com.

Rabeeh AMK

unread,
Aug 13, 2021, 7:34:18 AM8/13/21
to Flutter Development (flutter-dev)
How To Connect MSSQL With Flutter Application?
Reply all
Reply to author
Forward
0 new messages