connect method
Future<bool>
connect({
- required String ip,
- required String port,
- required String databaseName,
- required String username,
- required String password,
- int timeoutInSeconds = 30,
override
Connects to the MS SQL Server database.
The required parameters are the IP address, port, database name, username, password, and an optional timeout in seconds.
Implementation
@override
Future<bool> connect({
required String ip,
required String port,
required String databaseName,
required String username,
required String password,
int timeoutInSeconds = 30,
}) async {
try {
final bool? result = await methodChannel.invokeMethod<bool>('connect', {
'server': '$ip,$port',
'database': databaseName,
'user': username,
'password': password,
'timeout': timeoutInSeconds.toString(),
});
return result ?? false;
} on PlatformException catch (e) {
throw refineError(e.message ?? e.toString());
} catch (e) {
throw refineError(e.toString());
}
}