OledDb database connections allow C# developers to build data powered applications with Access database. It can be possible with Database connection object and command object. Connection string For connecting .mdb Access files you can use the following connection string, string connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:/.Net Project/PharmaERP/PharmaERP/PharmaData.mdb"; and for the Access 2007, 2012,2016 databases you have to use the following one. string connstr = "Provider=Microsoft.ACE.OLEDB.12.0;;Data Source=D:/.Net Project/PharmaERP/pharmaData.accdb;Jet OLEDB:Database Password=password"; Now we are ready to setup the connection, let build the connection objects and get started. Connecting database with OleDbConnection object. OleDbConnection conn; OleDbCommand Rs; public void Connect() { conn = new OleDbConnection(connstr); conn.Open(); } With the OleDbConnection o
Accessing system property is pretty easy with VB6 code. This can be useful when programmers need to refer the system name in the code. Steps Declare the GetComputerNameA function which resides in the kernel32 library. Create a function to fetch the Computer Name. Use the function The Kernel functions Declare Function GetComputerNameA Lib "kernel32" (ByVal lpBuffer As String, nSize As Long) As Long Get the computer name Define a new function to do the rest of the task. So you can reuse the code. Public Function GetComputerName() As String Dim sResult As String * 255 GetComputerNameA sResult, 255 GetComputerName = Left$(sResult, InStr(sResult, Chr$(0)) - 1) End Function Calling the function Just invoke the function and place values to a TextBox Text1.Text = GetComputerName
Flask is a Python framework which can be used to build the web application from scratch. Flask is a micro-framework which capable to build websites like Instagram, twitter and anything at programmers will. SqlAlchemy is a package in Python Flask which simplifies database connections. The following simple Application will explain ..... how. This project was built on windows OS and Pycharm IDE The connection string from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['DATABASE_FILE'] = 'app2.db' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + app.config['DATABASE_FILE'] app.config['SECRET_KEY'] = '123456790' db = SQLAlchemy(app) So the db is like the cursor to the database. Read More The complete SQLite Project can be downloaded from GitHub
Comments
Post a Comment