SIGN UP MEMBER LOGIN:    
ARTICLE

Kuti.Data

Posted by odegirmenci Articles | ADO.NET in C# July 02, 2003
The attached source code file has two parts - DataObject directory and Automatic SQL Generator.
Reader Level:
Download Files:
 

The attached source code file has two parts - DataObject directory and Automatic SQL Generator. 

DataObject Directory

First parts which is under DataObject directory has provides database functionality. It can connect 3 types of database (MSSQL, MySQL and Access)and can execute SQL in these databases. It takes the return rown in its Items array and you can use them as an DataReader object. All return values are as DataItem object which defined in the same directory. DataItem has many function to return Field values. You can use either fieldname or index of the field to get data. GetString, GetInt, GetBoolean, GetDateTime are some of useful methods which you can use to get data.

It is so simple to use this object. You have to only create an object which name is GDataObject and set the Database Type.

Example:

using Kuti.Data;
GDataObject data =
new GDataObject(GDatabaseType.MSSQL) ; // can be also Access or MySQL
data.Username = "myuser";
data.Password = "mypass";
data.DataSource = "localhost";
data.Database = "mydb";
or you can
set these properties by ;
data.SetSomeProperties("myuser", "mypass", "localhost", "mydb");
data.CreateConnectionString();
data.Connect();
data.SQLString = "Select .....";
data.ExecuteForObjects();
// also Execute(), ExecuteScaler(), ExecuteNonQuery() available
for(int i = 0; i < data.Count; i++)
{
data[i].GetString(fieldname);
data[i].GetBoolean(2);
}

Automatic SQL Generator

Second part is the automatic SQL Generator. This program generates you SQL in an order and can be read SQL from an SQL or txt file. The only thing you have to do is setting header in each SQL part. This header structure and example SQL file is under the Kuti.DAta/CheckDatabase/SQL/Example.sql file. Headers tells the program what program will do with this SQL. Program also holds error messages when an error occurred in any of the SQL part.

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor