dart_mssql 0.1.0+1 dart_mssql: ^0.1.0+1 copied to clipboard
High Performance Microsoft SQL Server Driver for Dart (32 & 64bits)
dart_mssql #
High Performance Microsoft SQL Server Driver for Dart (32 & 64bits)
Important #
- Works only on Windows (32bits or 64bits)
- You have to install OLE DB Driver
- dart_mssql.dll in this repository is the 64 bits version. If you need the 32 bits version please compile the source and target as you need.
Example Usage #
Demo code to perform Raw SQL queries
import 'package:dart_mssql/dart_mssql.dart';
void main() async {
MssqlConnection connection = MssqlConnection("SERVERNAME", "DBNAME", "USERNAME", "PASSWORD");
int id = 1;
String cmd = "select * from nacionalidade where id_nacionalidade=$id"; // sorry! param binding not yet implemented!
SqlResult result = await connection.execute(cmd);
print("${result.rows.toString()}");
}
Troubleshooting #
Problem:
The specified module could not be found.
error: library handler failed
Cause:
Missing dart_mssql.dll file into project main directory.
Solution:
Copy dart_mssql.dll file into project main directory.
Compile with Microsoft Visual Studio 2017 Community Edition #
- Before compile, you have to install Windows 10 SDK on your Microsoft Visual Studio 2017 Community Edition
- Open solution file dart_mssql\cpp\dart_mssql.sln with Microsoft Visual Studio 2017 Community Edition
- On "Solution Explorer" Panel right click on dart_mssql project and select "Rebuild"
- Put the generated dart_mssql.dll file into your project main folder (same folder of your pubspec.yaml file)
- Be sure to have correct dart-sdk\bin folder (32 or 64 bits) in VC++ Directories -> Library Directories. Change "F:\DartSDK64\dart-sdk\bin" to your location
- Be sure to have correct dart.lib version (32 or 64 bits) in Linker -> Input -> Additional Dependencies. Change "F:\DartSDK64\dart-sdk\bin\dart.lib" to your location