mssql_connection

Creator: coderz1093

Last updated:

Add to Cart

Description:

mssql connection

MSSQL Connection Plugin #
The mssql_connection plugin allows Flutter applications to connect to and interact with Microsoft SQL Server databases.
Easily connect and interact with Microsoft SQL Server databases on Android using the mssql_connection plugin. 🚀 This plugin offers seamless database operations, including querying and data manipulation. Connect securely with customizable timeouts and disconnect effortlessly. Simplify your database tasks and streamline Android app development with mssql_connection. 🔗
Features #

🔄 Seamless Microsoft SQL Server integration.\n
📊 Execute queries and fetch data effortlessly.
⏳ Customize connection timeouts for secure operations.
🚀 Simplified API for easy Android app development.
🧩 Android platform support.

Installation #
To use the MsSQL Connection plugin in your Flutter project, follow these simple steps:


Open pubspec.yaml: Add the following dependency to your project's pubspec.yaml file:
dependencies:
mssql_connection: ^1.0.0
copied to clipboard
Replace ^1.0.0 with the latest version available.


Install Packages: Run the following command in your terminal to fetch and install the plugin:
flutter pub get
copied to clipboard


Import in Dart Code: Import the MsSQL Connection package in your Dart code:
import 'package:mssql_connection/mssql_connection.dart';
copied to clipboard


Initialize the Connection: Create an instance of MssqlConnection to use the plugin:
MssqlConnection mssqlConnection = MssqlConnection.getInstance();
copied to clipboard


Use the Plugin: Now you're ready to use the MsSQL Connection plugin to interact with your Microsoft SQL Server database.


Usage/Examples #
       

Connect to Database #
To establish a connection to the Microsoft SQL Server database, use the connect method. This method takes the server details, including IP, port, database name, username, and password.
// Example: Connect to the database
bool isConnected = await mssqlConnection.connect(
ip: 'your_server_ip',
port: 'your_server_port',
databaseName: 'your_database_name',
username: 'your_username',
password: 'your_password',
timeoutInSeconds: 15,
);

// Returns a boolean indicating the connection status.
copied to clipboard
Get Data #
Retrieve data from the connected database using the getData method. Pass the SQL query as parameter to getData method to fetch the desired information.
// Example: Fetch data from the database
String query = 'SELECT * FROM your_table';
String result = await mssqlConnection.getData(query);

// Returns a string containing the fetched data in JSON format.
copied to clipboard
Write Data #
Write data to the connected database using the writeData method. Pass the SQL query as parameter to writeData method for database modification.
// Example: Update data in the database
String query = 'UPDATE your_table SET column_name = "new_value" WHERE condition';
String result = await mssqlConnection.writeData(query);

// Returns a string containing information about the operation, e.g., affected rows.
copied to clipboard
Disconnect #
Terminate the database connection using the disconnect method.
// Example: Disconnect from the database
bool isDisconnected = await mssqlConnection.disconnect();

// Returns a boolean indicating the disconnection status.
copied to clipboard
These methods cover the basic functionalities provided by the MsSQL Connection plugin. Customize the SQL queries according to your database schema and requirements.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.